<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Richard123</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Richard123"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Richard123"/>
	<updated>2026-06-27T20:25:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993514</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993514"/>
		<updated>2022-10-30T10:42:58Z</updated>

		<summary type="html">&lt;p&gt;Richard123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Suggestions etc==&lt;br /&gt;
&#039;&#039;&#039;Suggestions are always welcome!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Just do not directly enter it into the page. Rather switch to the talk page and write down your thoughts. Or send an email to the author.&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
Browser specifics in this tutorial refer to FireFox in a fairly current version.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla! web page. A Site Module creates output for the end users. An Administrtor Module would create outbut in the administration interface.)&lt;br /&gt;
&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# To define where to display the warning in the web page select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Notice the text in the editor field: &amp;amp;lt;p&amp;amp;gt;By using this site you accept cookies!&amp;amp;lt;/p&amp;amp;gt;. (The surrounding &amp;amp;lt;p&amp;amp;gt; and &amp;amp;lt;/p&amp;amp;gt; tags define the text as a paragraph in HTML.)&lt;br /&gt;
# Add a Return or new line at the end of the existing code. Maybe add another one to make it look better.&lt;br /&gt;
# Now copy the following code snippet below the existing text of the message.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will discuss later what this code exactly is doing.&lt;br /&gt;
&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window showing the site view and refresh. You should not only see the warning, but also the button. (Refreshing may be done by clicking the circular icon or by pressing the F5 key. If it does not help try pressing Ctrl-F5.)&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# The onclick contains two JavaScript commands, each terminated with a ; (semicolon).&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because the double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the name cookies and the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and then sets a marker in the users browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which defines it&#039;s content to be JavaScript. This JavaScript is executed every time the browser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
The JavaScript tag is composed from the following:&lt;br /&gt;
&lt;br /&gt;
# The opening HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement with a test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the cache of the end users browser which is named cookies and has a content of accepted.&lt;br /&gt;
# If that cookie exists the test result ist positive (true) and the commands in the curly brackets are executed.&lt;br /&gt;
# In the curly braces is a command we already know. Hide the Cookie Warning.&lt;br /&gt;
# The closing HTML &amp;lt;/script&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no such cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it every time the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Start debugging===&lt;br /&gt;
In the browser open the developer tools. In FireFox that is done with the key combination: Shift+Ctrl+I&lt;br /&gt;
&lt;br /&gt;
At the very top of the debuging window select the Inspector tab and search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
====Check if the cookie is created====&lt;br /&gt;
# Again at the very top of the debuging window select the Storage tab.&lt;br /&gt;
# Open the Cookies file&lt;br /&gt;
# Open your domain name, it should be there.&lt;br /&gt;
# In the content area there should be at least 2 cookies. One is the Joomla! cookie for tracking your session. The other should be the cookie just set by clicking the I accept button.&lt;br /&gt;
&lt;br /&gt;
Everything is fine until now.&lt;br /&gt;
====Check if the class cookieWarning is used====&lt;br /&gt;
There is only one more thing. If the cookie is there, the JavaScript tag is not doing its job correct.&lt;br /&gt;
# Switch back to the Inspector tab of the debugging tools.&lt;br /&gt;
# Enter #cookieWarning into the search field and press Return to jump to the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
-- Ups, an Error! &lt;br /&gt;
OK, let us try to enter Cookie Warning into the search field again. and analyse the HTML.&lt;br /&gt;
&lt;br /&gt;
All kinds of classes, but no ID named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning in the administator window again, if it is not still open.&lt;br /&gt;
# Toggle the editor to see the HTML code.&lt;br /&gt;
# Notice that the editor added some more &amp;amp;lt;p&amp;amp;gt;...&amp;amp;lt;/p&amp;amp;gt; tags. No problem, if it likes to see everything as a paragraph.&lt;br /&gt;
# At the very top insert the following: &amp;amp;lt;div id=&amp;quot;cookieWarning&amp;quot;&amp;amp;gt;&lt;br /&gt;
# Right above the &amp;amp;lt;script&amp;amp;gt; tag insert: &amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;
# So we gave our HTML a surrounding division tag with an ID of #cookieWarning.&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser end user browser window.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=JDOC:Joomla_4_Tutorials_Project&amp;diff=993513</id>
		<title>JDOC:Joomla 4 Tutorials Project</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=JDOC:Joomla_4_Tutorials_Project&amp;diff=993513"/>
		<updated>2022-10-30T10:23:19Z</updated>

		<summary type="html">&lt;p&gt;Richard123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Top portal heading|color=white-bkgd|icon=joomla|icon-color=#5091cd|size=5x|text-color=#333|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Joomla 4 Tutorials Project&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; This &#039;&#039;&#039;Joomla! Documentation Wiki Tutorial Project&#039;&#039;&#039; is focused on providing tutorials to help Beginners and Developers with the main changes of Joomla 4. The Joomla Docs Wiki is collaborative, community-contributed and maintained, anyone can get involved in the Joomla 4 Tutorials Project! There are many small tasks in this JDOC project that when combined together will help produce high quality tutorials for beginner and intermediate Joomla! developers. Show others your interest in the Joomla project, sign up to help with this Docs Wiki Project on the discussion page.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 column&amp;quot;&amp;gt;&lt;br /&gt;
{{section portal heading|icon=magic|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; Joomla 4 Tutorials Maintained&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== For Newcomers == &amp;lt;!--T:51--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{J4.x:Links:_Getting_Started/&amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt; en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
=== Articles ===&lt;br /&gt;
* [[S:MyLanguage/J4.x:Adding a New Article|&amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;gt; Adding a New Article&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Deleting an Article|&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt; Deleting an Article&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Restricting_access_to_an_Article|&amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt; Restricting access to an Article&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Scheduling_the_publication_of_an_article|&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt; Scheduling the Publication of an Article&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:How_to_Archive_an_Article|&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt; How to Archive an Article&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
*[[S:MyLanguage/J4.x:How_to_Show_a_Calendar_Month_List_of_Archived_Articles_Using_a_Module|&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt; How to Show a Calendar Month List of Archived Articles Using a Module&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
{{J4.x:Links:_Media/&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt; en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
=== Other ===&lt;br /&gt;
* [[S:MyLanguage/J4.x:How_To_Use_Content_Tags_in_Joomla|&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt; How To Use Content Tags in Joomla&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [https://domorewithcore.com/new-in-joomla-4-1 New in Joomla 4.1]&lt;br /&gt;
* [https://joomla-projects.github.io/joomla-a11y-checker/ JOOA11Y - The Joomla Accessibility Checker]&lt;br /&gt;
* [[J4.x:Cookie_Warning_Tutorial|Cookie Warning Tutorial]]&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== For Upgraders == &amp;lt;!--T:52--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[S:MyLanguage/Potential backward compatibility issues in Joomla 4|&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt; Potential backward compatibility issues in Joomla 4&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/Joomla_3.x_to_4.x_Step_by_Step_Migration|&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; Joomla 3.x to 4.x Step by Step Migration&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== For Maintainers == &amp;lt;!--T:53--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/J4.x:Adding_a_New_Menu|&amp;lt;translate&amp;gt; &amp;lt;!--T:72--&amp;gt; Adding a New Menu&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Adding_a_menu_link_in_an_article|&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt; Adding a menu link in an article&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:How_to_Create_a_Menu_Item_to_View_Archived_Articles|&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt; How to Create a Menu Item to View Archived Articles&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Adding_a_Custom_Administrator_Menu|&amp;lt;translate&amp;gt; &amp;lt;!--T:54--&amp;gt; Adding a Custom Administrator Menu&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/WebAuthn_Passwordless_Login|&amp;lt;translate&amp;gt; &amp;lt;!--T:73--&amp;gt; WebAuthn Passwordless Login&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Multi-factor_Authentication|&amp;lt;translate&amp;gt; &amp;lt;!--T:79--&amp;gt; Multi-factor Authentication&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Workflow|&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt; Workflow&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Http_Header_Management|&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt; How to Use the New HTTP Header Management&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:CLI_Database_Exporter_Importer|&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; CLI Database Exporter Importer&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Improved_Override_Management|&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt; Improved Override Management&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Using Bootstrap Components in Joomla 4|&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt; Using Bootstrap Components in Joomla 4&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== For Developers == &amp;lt;!--T:55--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[S:MyLanguage/J4.x:Creating_a_Plugin_for_Joomla|&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt; Creating a Plugin for Joomla 4&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Adding_an_API_to_a_Joomla_Component|&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt; Adding an API to a Joomla Component&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Creating_a_Simple_Module|&amp;lt;translate&amp;gt; &amp;lt;!--T:22--&amp;gt; Creating a simple Module for Joomla 4&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Links:_MVC_Anatomy|&amp;lt;translate&amp;gt; &amp;lt;!--T:81--&amp;gt; MVC Anatomy&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:SCSS_and_Sass|&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; SCSS and Sass&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Setting_Up_Your_Local_Environment|&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt; Setting up your local environment&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/Setting_up_Eclipse_PDT_2020_and_Git_for_Pulls|&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt; Setting up Eclipse PDT 2020 and Git for Pulls&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/Visual_Studio_Code_Primer|&amp;lt;translate&amp;gt;&amp;lt;!--T:101--&amp;gt; Visual Studio Code Primer&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Web_Assets|&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt; Web Assets&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/Adding changelog to your manifest file|&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt; Adding changelog to your manifest file&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Dependency_Injection_in_Joomla_4|&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; Dependency Injection in Joomla 4&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Moving_Joomla_To_Prepared_Statements|&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; Moving Joomla to Prepared Statements&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Namespace_Conventions_In_Joomla|&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; Namespace conventions in Joomla 4&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Writing_A_CLI_Application|&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt; Writing a CLI Application with the new Console Package&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
** [[S:MyLanguage/J4.x:Cloud_File_Systems_for_Media_Manager|&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt; How to build a cloud file system plugin for the new Media Manager&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
* Joomla 4&#039;s API: There are several pages documentation which you can find linked [[S:MyLanguage/Category:Joomla!_Api|in this Category on the Wiki]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Deploying_an_Update_Server|&amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt; Deploying an Update Server&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== For Documenters == &amp;lt;!--T:56--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[S:MyLanguage/Help4.x:Help_screens|&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt; Joomla 4 Help Screens&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/Help4.x:Chunks|&amp;lt;translate&amp;gt; &amp;lt;!--T:57--&amp;gt; Joomla 4 Chunks&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Doc_Pages|&amp;lt;translate&amp;gt; &amp;lt;!--T:58--&amp;gt; Joomla 4 Doc Pages&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Help_pages|&amp;lt;translate&amp;gt; &amp;lt;!--T:62--&amp;gt; Joomla 4 Help Pages&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J3.x:Doc_Pages|&amp;lt;translate&amp;gt; &amp;lt;!--T:61--&amp;gt; Joomla 3 Doc Pages&amp;lt;/translate&amp;gt;]] &amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt; (for comparison)&amp;lt;/translate&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/JDOC_Manual|&amp;lt;translate&amp;gt; &amp;lt;!--T:64--&amp;gt; JDOC Manual&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
* [[J4.x:Links:_Index|Links: Index]]&lt;br /&gt;
&lt;br /&gt;
== Appendices == &amp;lt;!--T:59--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=====Joomla 4.x Extensions - Simple working examples explained===== &amp;lt;!--T:41--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[S:MyLanguage/J4 Plugin example - Table of Contents|&amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt; J4 Plugin example - Table of Contents&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4 Component example - Mywalks|&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt; J4 Component example - Mywalks&amp;lt;/translate&amp;gt;]] - &amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt; Updated for Beta 4&amp;lt;/translate&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/J4 Module example - Mydownmsg|&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt; J4 Module example - Mydownmsg&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4 CLI example - Onoffbydate|&amp;lt;translate&amp;gt;&amp;lt;!--T:50--&amp;gt; J4 CLI example - Onoffbydate&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
* [[J4.x:Tips and Tricks for Joomla 4 Developers|&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt; Tips and Tricks for Joomla 4 Developers&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 column&amp;quot;&amp;gt;&lt;br /&gt;
{{section portal heading|icon=check-square|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; To Do List&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; These are a few &#039;to do&#039;s&#039; to get this project startedː&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
* How to use the new Publishing Workflow&lt;br /&gt;
* How to create an accessible template&lt;br /&gt;
* How to test the accessibility of an extension&lt;br /&gt;
* [[S:MyLanguage/J4.x:Developing_an_MVC_Component|Developing an MVC component]]&lt;br /&gt;
* Joomla! 4 Component Development Tutorial&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
* What&#039;s changed in Joomla 4? (vs backwards compatibility)&lt;br /&gt;
* Custom Admin User Dashboards&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
* Plugin: System - Additional Accessibility Features&lt;br /&gt;
* Upgrading Joomla 4: Pre Update Check&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
* Making a language pack for Joomla 4 ([[J3.x:Making a Language Pack for Joomla|J3 version]])&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
== Templates ==&lt;br /&gt;
* [[J4.x:Cassiopeia Template Folders and Files|Cassiopeia Template Folders and Files]]&lt;br /&gt;
* [[J4.x:Cassiopeia Template Customisation|Cassiopeia Template Customisation]] - using the Edit Style form and user.css&lt;br /&gt;
* [[J4.x:Cassiopeia Template Simplified - A Case Study|Cassiopeia Template Simplified - A Case Study]] - a simple template based on Cassiopeia&lt;br /&gt;
* [https://magazine.joomla.org/all-issues/february-2022/joomla-4-cassiopeia-template-a-bunch-of-tips-tricks Community Magazine: Cassiopeia Template – Tips &amp;amp; Tricks]&lt;br /&gt;
* Atum Template - Back End Template for Joomla 4&lt;br /&gt;
* HTML Mail Templates&lt;br /&gt;
&lt;br /&gt;
== Joomla 4 User Manual Experiment ==&lt;br /&gt;
&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Getting_Started|&amp;lt;translate&amp;gt;&amp;lt;!--T:84--&amp;gt; Getting Started&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Problems|&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt; Problems&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Dashboards|&amp;lt;translate&amp;gt;&amp;lt;!--T:86--&amp;gt; Dashboards&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Articles|&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt; Articles&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Workflows|&amp;lt;translate&amp;gt;&amp;lt;!--T:88--&amp;gt; Workflows&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Fields|&amp;lt;translate&amp;gt;&amp;lt;!--T:89--&amp;gt; Fields&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Media|&amp;lt;translate&amp;gt;&amp;lt;!--T:90--&amp;gt; Media&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Modules|&amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt; Modules&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Menus|&amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt; Menus&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Banners|&amp;lt;translate&amp;gt;&amp;lt;!--T:93--&amp;gt; Banners&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Contacts|&amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt; Contacts&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Multilingual_Associations|&amp;lt;translate&amp;gt;&amp;lt;!--T:95--&amp;gt; Multilingual Associations&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#News_Feeds|&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt; News Feeds&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Smart_Search|&amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt; Smart Search&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Tags|&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt; Tags&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#Users|&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt; Users&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
* [[S:MyLanguage/J4.x:Joomla_4_User_Manual#System|&amp;lt;translate&amp;gt;&amp;lt;!--T:100--&amp;gt; System&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 column&amp;quot;&amp;gt;{{section portal heading|icon=plus|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; Join This JDOC Project&amp;lt;/translate&amp;gt;}}{{JDOC:Beginners_Tutorial_Project/Get Involved/&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 column&amp;quot;&amp;gt;&lt;br /&gt;
{{section portal heading|icon=question|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; FAQ&amp;lt;/translate&amp;gt;}}{{JDOC:Developer_Tutorials_Project/FAQs/&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 column&amp;quot;&amp;gt;&lt;br /&gt;
{{section portal heading|icon=group|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; Members of this Project&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Members== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
*[[User:Sandra97|Sandra Decoux]]&lt;br /&gt;
*[[User:Hutchy68|Tom Hutchison]]&lt;br /&gt;
*[[User:MartijnM|Martijn Maandag]]&lt;br /&gt;
*[[User:M-b-o|Mike Brandner, Teamlead JDocs]]&lt;br /&gt;
*[[User:Wilsonge|George Wilson, Joomla 4 Release Lead]]&lt;br /&gt;
*[[User:Partic|Patrick Jackson]]&lt;br /&gt;
{{section portal heading|icon=book|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; News&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; The JDOC Joomla 4 Tutorials Project was started on Sat, 08 Dec 2018 in an effort to benefit the users of the Joomla! Documentation Wiki.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:JDOC Projects{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla!_4.x{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993512</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993512"/>
		<updated>2022-10-30T09:06:25Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Check if the class cookieWarning is used */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
Browser specifics in this tutorial refer to FireFox in a fairly current version.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla! web page. A Site Module creates output for the end users. An Administrtor Module would create outbut in the administration interface.)&lt;br /&gt;
&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# To define where to display the warning in the web page select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Notice the text in the editor field: &amp;amp;lt;p&amp;amp;gt;By using this site you accept cookies!&amp;amp;lt;/p&amp;amp;gt;. (The surrounding &amp;amp;lt;p&amp;amp;gt; and &amp;amp;lt;/p&amp;amp;gt; tags define the text as a paragraph in HTML.)&lt;br /&gt;
# Add a Return or new line at the end of the existing code. Maybe add another one to make it look better.&lt;br /&gt;
# Now copy the following code snippet below the existing text of the message.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will discuss later what this code exactly is doing.&lt;br /&gt;
&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window showing the site view and refresh. You should not only see the warning, but also the button. (Refreshing may be done by clicking the circular icon or by pressing the F5 key. If it does not help try pressing Ctrl-F5.)&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# The onclick contains two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot;.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because the double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the name cookies and the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and then sets a marker in the users browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which defines it&#039;s content to be JavaScript. This JavaScript is executed every time the browser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
The JavaScript tag is composed from the following:&lt;br /&gt;
&lt;br /&gt;
# The opening HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement with a test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the cache of the end users browser which is named cookies and has a content of accepted.&lt;br /&gt;
# If that cookie exists the test result ist positive (true) and the commands in the curly brackets are executed.&lt;br /&gt;
# In the curly braces is a command we already know. Hide the Cookie Warning.&lt;br /&gt;
# The closing HTML &amp;lt;/script&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no such cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it every time the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Start debugging===&lt;br /&gt;
In the browser open the developer tools. In FireFox that is done with the key combination: Shift+Ctrl+I&lt;br /&gt;
&lt;br /&gt;
At the very top of the debuging window select the Inspector tab and search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
====Check if the cookie is created====&lt;br /&gt;
# Again at the very top of the debuging window select the Storage tab.&lt;br /&gt;
# Open the Cookies file&lt;br /&gt;
# Open your domain name, it should be there.&lt;br /&gt;
# In the content area there should be at least 2 cookies. One is the Joomla! cookie for tracking your session. The other should be the cookie just set by clicking the I accept button.&lt;br /&gt;
&lt;br /&gt;
Everything is fine until now.&lt;br /&gt;
====Check if the class cookieWarning is used====&lt;br /&gt;
There is only one more thing. If the cookie is there, the JavaScript tag is not doing its job correct.&lt;br /&gt;
# Switch back to the Inspector tab of the debugging tools.&lt;br /&gt;
# Enter #cookieWarning into the search field and press Return to jump to the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
-- Ups, an Error! &lt;br /&gt;
OK, let us try to enter Cookie Warning into the search field again. and analyse the HTML.&lt;br /&gt;
&lt;br /&gt;
All kinds of classes, but no ID named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning in the administator window again, if it is not still open.&lt;br /&gt;
# Toggle the editor to see the HTML code.&lt;br /&gt;
# Notice that the editor added some more &amp;amp;lt;p&amp;amp;gt;...&amp;amp;lt;/p&amp;amp;gt; tags. No problem, if it likes to see everything as a paragraph.&lt;br /&gt;
# At the very top insert the following: &amp;amp;lt;div id=&amp;quot;cookieWarning&amp;quot;&amp;amp;gt;&lt;br /&gt;
# Right above the &amp;amp;lt;script&amp;amp;gt; tag insert: &amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;
# So we gave our HTML an ID of #cookieWarning.&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser end user browser window.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993511</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993511"/>
		<updated>2022-10-30T09:00:26Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Now start debugging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
Browser specifics in this tutorial refer to FireFox in a fairly current version.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla! web page. A Site Module creates output for the end users. An Administrtor Module would create outbut in the administration interface.)&lt;br /&gt;
&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# To define where to display the warning in the web page select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Notice the text in the editor field: &amp;amp;lt;p&amp;amp;gt;By using this site you accept cookies!&amp;amp;lt;/p&amp;amp;gt;. (The surrounding &amp;amp;lt;p&amp;amp;gt; and &amp;amp;lt;/p&amp;amp;gt; tags define the text as a paragraph in HTML.)&lt;br /&gt;
# Add a Return or new line at the end of the existing code. Maybe add another one to make it look better.&lt;br /&gt;
# Now copy the following code snippet below the existing text of the message.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will discuss later what this code exactly is doing.&lt;br /&gt;
&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window showing the site view and refresh. You should not only see the warning, but also the button. (Refreshing may be done by clicking the circular icon or by pressing the F5 key. If it does not help try pressing Ctrl-F5.)&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# The onclick contains two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot;.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because the double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the name cookies and the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and then sets a marker in the users browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which defines it&#039;s content to be JavaScript. This JavaScript is executed every time the browser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
The JavaScript tag is composed from the following:&lt;br /&gt;
&lt;br /&gt;
# The opening HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement with a test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the cache of the end users browser which is named cookies and has a content of accepted.&lt;br /&gt;
# If that cookie exists the test result ist positive (true) and the commands in the curly brackets are executed.&lt;br /&gt;
# In the curly braces is a command we already know. Hide the Cookie Warning.&lt;br /&gt;
# The closing HTML &amp;lt;/script&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no such cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it every time the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Start debugging===&lt;br /&gt;
In the browser open the developer tools. In FireFox that is done with the key combination: Shift+Ctrl+I&lt;br /&gt;
&lt;br /&gt;
At the very top of the debuging window select the Inspector tab and search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
====Check if the cookie is created====&lt;br /&gt;
# Again at the very top of the debuging window select the Storage tab.&lt;br /&gt;
# Open the Cookies file&lt;br /&gt;
# Open your domain name, it should be there.&lt;br /&gt;
# In the content area there should be at least 2 cookies. One is the Joomla! cookie for tracking your session. The other should be the cookie just set by clicking the I accept button.&lt;br /&gt;
&lt;br /&gt;
Everything is fine until now.&lt;br /&gt;
====Check if the class cookieWarning is used====&lt;br /&gt;
There is only one more thing. If the cookie is there, the JavaScript tag is not doing its job correct.&lt;br /&gt;
# Switch back to the Inspector tab of the debugging tools.&lt;br /&gt;
# Enter #cookieWarning into the search field and press Return to jump to the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
-- Ups, an Error! &lt;br /&gt;
OK, let us try to enter Cookie Warning into the search field again. and analyse the HTML.&lt;br /&gt;
&lt;br /&gt;
All kinds of classes, but no ID named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning in the administator window again, if it is not still open.&lt;br /&gt;
# Toggle the editor to see the HTML code.&lt;br /&gt;
# Notice that the editor added some more &amp;lt;p&amp;gt;...&amp;lt;/p&amp;gt; tags. No problem, if it likes to see everything as a paragraph.&lt;br /&gt;
# At the very top insert the following: &amp;lt;div id=&amp;quot;cookieWarning&amp;quot;&amp;gt;&lt;br /&gt;
# Right above the &amp;lt;script&amp;gt; tag insert: &amp;lt;/div&amp;gt;&lt;br /&gt;
# So we gave our HTML a ID of #cookieWarning.&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser end user browser window.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993510</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993510"/>
		<updated>2022-10-30T08:08:45Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Before debugging, take a brief look at what the code is doing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
Browser specifics in this tutorial refer to FireFox in a fairly current version.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla! web page. A Site Module creates output for the end users. An Administrtor Module would create outbut in the administration interface.)&lt;br /&gt;
&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# To define where to display the warning in the web page select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Notice the text in the editor field: &amp;amp;lt;p&amp;amp;gt;By using this site you accept cookies!&amp;amp;lt;/p&amp;amp;gt;. (The surrounding &amp;amp;lt;p&amp;amp;gt; and &amp;amp;lt;/p&amp;amp;gt; tags define the text as a paragraph in HTML.)&lt;br /&gt;
# Add a Return or new line at the end of the existing code. Maybe add another one to make it look better.&lt;br /&gt;
# Now copy the following code snippet below the existing text of the message.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will discuss later what this code exactly is doing.&lt;br /&gt;
&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window showing the site view and refresh. You should not only see the warning, but also the button. (Refreshing may be done by clicking the circular icon or by pressing the F5 key. If it does not help try pressing Ctrl-F5.)&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# The onclick contains two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot;.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because the double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the name cookies and the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and then sets a marker in the users browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which defines it&#039;s content to be JavaScript. This JavaScript is executed every time the browser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
The JavaScript tag is composed from the following:&lt;br /&gt;
&lt;br /&gt;
# The opening HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement with a test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the cache of the end users browser which is named cookies and has a content of accepted.&lt;br /&gt;
# If that cookie exists the test result ist positive (true) and the commands in the curly brackets are executed.&lt;br /&gt;
# In the curly braces is a command we already know. Hide the Cookie Warning.&lt;br /&gt;
# The closing HTML &amp;lt;/script&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no such cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it every time the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993509</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993509"/>
		<updated>2022-10-30T06:45:20Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a button to hide the message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
Browser specifics in this tutorial refer to FireFox in a fairly current version.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla! web page. A Site Module creates output for the end users. An Administrtor Module would create outbut in the administration interface.)&lt;br /&gt;
&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# To define where to display the warning in the web page select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Notice the text in the editor field: &amp;amp;lt;p&amp;amp;gt;By using this site you accept cookies!&amp;amp;lt;/p&amp;amp;gt;. (The surrounding &amp;amp;lt;p&amp;amp;gt; and &amp;amp;lt;/p&amp;amp;gt; tags define the text as a paragraph in HTML.)&lt;br /&gt;
# Add a Return or new line at the end of the existing code. Maybe add another one to make it look better.&lt;br /&gt;
# Now copy the following code snippet below the existing text of the message.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will discuss later what this code exactly is doing.&lt;br /&gt;
&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window showing the site view and refresh. You should not only see the warning, but also the button. (Refreshing may be done by clicking the circular icon or by pressing the F5 key. If it does not help try pressing Ctrl-F5.)&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993508</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993508"/>
		<updated>2022-10-30T06:38:47Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a button to hide the message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
Browser specifics in this tutorial refer to FireFox in a fairly current version.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla! web page. A Site Module creates output for the end users. An Administrtor Module would create outbut in the administration interface.)&lt;br /&gt;
&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# To define where to display the warning in the web page select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Notice the text in the editor field: &amp;lt;p&amp;gt;By using this site you accept cookies!&amp;lt;/p&amp;gt;. The surrounding &amp;lt;p&amp;gt; and &amp;lt;/p&amp;gt; tags define the text as a paragraph in HTML.&lt;br /&gt;
# Add a Return or new line at the end of the existing code. Maybe add another one to make it look better.&lt;br /&gt;
# Now copy the following code snippet below the existing text of the message.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will discuss later what this code exactly is doing.&lt;br /&gt;
&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window showing the site view and refresh. You should not only see the warning, but also the button. (Refreshing may be done by clicking the circular icon or by pressing the F5 key. If it does not help try pressing Ctrl-F5.)&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993507</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993507"/>
		<updated>2022-10-30T06:29:18Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* The installation of extensions bears certain risks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
Browser specifics in this tutorial refer to FireFox in a fairly current version.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla! web page. A Site Module creates output for the end users. An Administrtor Module would create outbut in the administration interface.)&lt;br /&gt;
&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# To define where to display the warning in the web page select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Notice the text in the editor field shows the text surrounded by &amp;lt;p&amp;gt; ... &amp;lt;/p&amp;gt; tags. They define the text as a paragraph in HTML.&lt;br /&gt;
# Add a Return or new line at the end of the existing code. Maybe add another one to make it look better.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will discuss later what this code exactly is doing.&lt;br /&gt;
&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993506</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993506"/>
		<updated>2022-10-30T06:24:03Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a button to hide the message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla! web page. A Site Module creates output for the end users. An Administrtor Module would create outbut in the administration interface.)&lt;br /&gt;
&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# To define where to display the warning in the web page select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Notice the text in the editor field shows the text surrounded by &amp;lt;p&amp;gt; ... &amp;lt;/p&amp;gt; tags. They define the text as a paragraph in HTML.&lt;br /&gt;
# Add a Return or new line at the end of the existing code. Maybe add another one to make it look better.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will discuss later what this code exactly is doing.&lt;br /&gt;
&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993505</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993505"/>
		<updated>2022-10-30T06:16:03Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a Site Module for the warning message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla! web page. A Site Module creates output for the end users. An Administrtor Module would create outbut in the administration interface.)&lt;br /&gt;
&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# To define where to display the warning in the web page select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message. (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993504</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993504"/>
		<updated>2022-10-30T06:08:58Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The article [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session and other information of visitors. Therefore, it might be necessary to provide appropriate notices. The Joomla! Framework itself does not include a feature to display cookie warnings.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
* Does the extension cost extra money and how much, once or repeating?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla!, HTML, CSS, JavaScript and the browser would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users in Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed.)&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state and leaving no residues.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# Select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message. (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Cookie_Warning_Tutorial&amp;diff=993449</id>
		<title>Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Cookie_Warning_Tutorial&amp;diff=993449"/>
		<updated>2022-10-28T22:05:20Z</updated>

		<summary type="html">&lt;p&gt;Richard123: Richard123 moved page Cookie Warning Tutorial to J4.x:Cookie Warning Tutorial: This tutorial is about Joomla 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[J4.x:Cookie Warning Tutorial]]&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993448</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993448"/>
		<updated>2022-10-28T22:05:19Z</updated>

		<summary type="html">&lt;p&gt;Richard123: Richard123 moved page Cookie Warning Tutorial to J4.x:Cookie Warning Tutorial: This tutorial is about Joomla 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla! itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# Select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message. (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993447</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993447"/>
		<updated>2022-10-28T21:56:58Z</updated>

		<summary type="html">&lt;p&gt;Richard123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.x}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla! itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# Select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message. (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Beginners]]&lt;br /&gt;
[[Category:Joomla! 4.x]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993446</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993446"/>
		<updated>2022-10-28T21:35:44Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* To be continued */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|4.x}}&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla! itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# Select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message. (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993445</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993445"/>
		<updated>2022-10-28T21:26:03Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Now start debugging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|4.x}}&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla! itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# Select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message. (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
# Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
# Select the Advanced tab.&lt;br /&gt;
# In the Module Class field enter cookieWarning&lt;br /&gt;
# Save the changes.&lt;br /&gt;
# Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993444</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993444"/>
		<updated>2022-10-28T21:24:33Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Before debugging, take a brief look at what the code is doing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|4.x}}&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla! itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# Select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message. (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
# There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
# Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
# There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
# The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
# The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
# Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
# The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
# An if statement whith test in the round brackets ().&lt;br /&gt;
# It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
# If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
# And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993443</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993443"/>
		<updated>2022-10-28T21:21:27Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a button to hide the message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|4.x}}&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla! itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# Select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# Now take the following code snippet and insert it below the existing message. (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap.)&lt;br /&gt;
# Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
# Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement whith test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993442</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993442"/>
		<updated>2022-10-28T21:17:18Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a Site Module for the warning message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|4.x}}&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla! itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
# Click Custom to create a Custom Site Module.&lt;br /&gt;
# Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later.)&lt;br /&gt;
# Select the Position main-top. (That would be right under the page header before the content.)&lt;br /&gt;
# Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# * Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# * Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# * Now take the following code snippet and insert it below the existing message (Maybe a &lt;br /&gt;
Carrige Return is needed to open a new line).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
#* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
#* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
#* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement whith test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993441</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993441"/>
		<updated>2022-10-28T21:08:32Z</updated>

		<summary type="html">&lt;p&gt;Richard123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|4.x}}&lt;br /&gt;
{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of this tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla! administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla! automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla! itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla! extensions that offer to present such a warning. {{jsite|ext}} is the official Joomla! Extensions Directory&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt;. The word cookie entered into the search field of this page will provide a multitude of free or paid extensions to handle cookies.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* Does the extension conflict with other installed extensions?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
* How does the extension behave in the next major upgrade?&lt;br /&gt;
* Will the extension still be supported in the next version?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla! Version 4.x (in short J4) is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for J4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla! 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
# * Click Custom to create a Custom Site Module.&lt;br /&gt;
# * Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
# * In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
# * Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
# * Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
# * Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
# * Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning.&lt;br /&gt;
# * Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning.&lt;br /&gt;
# * Now take the following code snippet and insert it below the existing message (Maybe a &lt;br /&gt;
Carrige Return is needed to open a new line).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
#* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
#* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
#* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement whith test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993440</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993440"/>
		<updated>2022-10-28T18:55:58Z</updated>

		<summary type="html">&lt;p&gt;Richard123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{inuse}}&lt;br /&gt;
Please leave this note until the didactic concept and structure of the tutorial are completed. The author is working on different parts of this document over several days. Once it is completed, the note will be set to Review.&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 13:55, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
* Click Custom to create a Custom Site Module.&lt;br /&gt;
* Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
* In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
* Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
* Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
* Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement whith test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Max123kl&amp;diff=993439</id>
		<title>User talk:Max123kl</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Max123kl&amp;diff=993439"/>
		<updated>2022-10-28T18:09:32Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Übersetzungsbenachrichtigung: J3.x:Upgrading from Joomla 3.4.x to 3.5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Hallo Max ==&lt;br /&gt;
&lt;br /&gt;
Du hast mein Tutorial editiert und die erste Zeile verändert. Ich vermute, es war in guter Absicht.&lt;br /&gt;
&lt;br /&gt;
Leider hast Du einen Aufruf hineingesetzt, der andere auffordert an dem Dokument mitzuschreiben. Dies mag eine gute Idee sein, wenn es darum geht in einer Hilfeseite einzelne Menüpunkte oder Felder in einem Formular zu beschreiben.&lt;br /&gt;
&lt;br /&gt;
Aber ich denke, bei einem Tutorial, in dem es um ein didaktisches Konzept geht ist dies kontraproduktiv. Es kann nicht angehen, dass ich am Ende des Dokuments Aussagen schreibe, die sich auf den Anfang beziehen und gleichzeitig ändert jemand anderes die an den Anfang gestellten Voraussetzungen ab.&lt;br /&gt;
&lt;br /&gt;
Ich möchte gern, dass das Tutorial für Änderungen gesperrt bleibt, bis die Struktur und das didaktische Konzept fertig gestellt sind.&lt;br /&gt;
&lt;br /&gt;
Deshalb möchte ich den Header wieder zurück ändern.&lt;br /&gt;
&lt;br /&gt;
Gruß Richard&lt;br /&gt;
&lt;br /&gt;
== Übersetzungsbenachrichtigung: J3.x:Upgrading from Joomla 3.4.x to 3.5 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div lang=&amp;quot;de&amp;quot; class=&amp;quot;mw-content-ltr&amp;quot;&amp;gt;Hallo Max123kl,&lt;br /&gt;
&lt;br /&gt;
du erhältst diese E-Mail, da du dich als Übersetzer(in) für Deutsch und German (formal address) auf Joomla! Documentation registriert hast.&lt;br /&gt;
Die Seite [[J3.x:Upgrading from Joomla 3.4.x to 3.5]] ist zum Übersetzen vorhanden. Du kannst sie hier übersetzen:&lt;br /&gt;
* [https://docs.joomla.org/index.php?title=Special:Translate&amp;amp;group=page-J3.x%3AUpgrading+from+Joomla+3.4.x+to+3.5&amp;amp;language=de übersetzen in Deutsch]&lt;br /&gt;
* [https://docs.joomla.org/index.php?title=Special:Translate&amp;amp;group=page-J3.x%3AUpgrading+from+Joomla+3.4.x+to+3.5&amp;amp;language=de-formal übersetzen in German (formal address)]&lt;br /&gt;
&lt;br /&gt;
Übersetzungspriorität dieser Seite: hoch.&lt;br /&gt;
Frist zur Übersetzung der Seite: 2016-03-16.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div lang=&amp;quot;en&amp;quot; class=&amp;quot;mw-content-ltr&amp;quot;&amp;gt;Hello,&lt;br /&gt;
&lt;br /&gt;
This is an urgent page to translate in a maximum of languages and before March 16th.&lt;br /&gt;
Thanks for the help.&lt;br /&gt;
&lt;br /&gt;
If you know friends able to translate it in other languages, Thank you to let them know how to help.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
MATsxm&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deine Hilfe wird sehr geschätzt. Übersetzer wie du helfen dabei, dass Joomla! Documentation&lt;br /&gt;
als wirklich mehrsprachige Gemeinschaft fungiert.&lt;br /&gt;
&lt;br /&gt;
Vielen Dank,&lt;br /&gt;
die Übersetzungskoordinatoren von Joomla! Documentation&amp;amp;lrm;, 13:25, 12 March 2016 (CST)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Translator welcome}} &lt;br /&gt;
([[User:Sandra97|Sandra97]] ([[User talk:Sandra97|talk]]) 15:19, 15 May 2017 (CDT))&lt;br /&gt;
&lt;br /&gt;
=== Note to your comment on [[J3.x:Installing_Joomla]] ===&lt;br /&gt;
Please use the &#039;&#039;&#039;Talk pages&#039;&#039;&#039; to leave comments on pages and about their content - not directly in the content of the page. I saw your comment and took it back. It makes the handling of translations too complex. Thanks for your hint. We will take it into account when revising the page.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[User:M-b-o|m-b-o (Mike Brandner)]] ([[User talk:M-b-o|talk]]) 17:45, 16 May 2020 (CDT)&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993375</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993375"/>
		<updated>2022-10-28T09:13:58Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Before debugging, take a brief look at what the code is doing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====This page is under construction. Please do not modify until this line is removed.====&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 02:24, 28 October 2022 (CDT)&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
* Click Custom to create a Custom Site Module.&lt;br /&gt;
* Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
* In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
* Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
* Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
* Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement whith test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993374</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993374"/>
		<updated>2022-10-28T09:06:48Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a button to hide the message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====This page is under construction. Please do not modify until this line is removed.====&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 02:24, 28 October 2022 (CDT)&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
* Click Custom to create a Custom Site Module.&lt;br /&gt;
* Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
* In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
* Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
* Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
* Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;;&lt;br /&gt;
&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993373</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993373"/>
		<updated>2022-10-28T08:51:26Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a button to hide the message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====This page is under construction. Please do not modify until this line is removed.====&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 02:24, 28 October 2022 (CDT)&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
* Click Custom to create a Custom Site Module.&lt;br /&gt;
* Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
* In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
* Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
* Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
* Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993372</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993372"/>
		<updated>2022-10-28T08:14:25Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a button to hide the message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====This page is under construction. Please do not modify until this line is removed.====&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 02:24, 28 October 2022 (CDT)&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
* Click Custom to create a Custom Site Module.&lt;br /&gt;
* Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
* In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
* Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
* Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
* Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message (Maybe a Carrige Return is needed to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993371</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993371"/>
		<updated>2022-10-28T08:09:32Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a Site Module for the warning message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====This page is under construction. Please do not modify until this line is removed.====&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 02:24, 28 October 2022 (CDT)&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module. (A module is a small component, which generates output on a Joomla web page.)&lt;br /&gt;
* Click Custom to create a Custom Site Module.&lt;br /&gt;
* Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
* In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
* Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
* Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
* Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message (Maybe a Carrige Return is needet to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993370</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993370"/>
		<updated>2022-10-28T08:04:27Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* The installation of extensions bears certain risks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====This page is under construction. Please do not modify until this line is removed.====&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 02:24, 28 October 2022 (CDT)&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for end users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
* Click Custom to create a Custom Site Module.&lt;br /&gt;
* Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
* In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
* Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
* Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
* Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message (Maybe a Carrige Return is needet to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Richard123&amp;diff=993369</id>
		<title>User talk:Richard123</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Richard123&amp;diff=993369"/>
		<updated>2022-10-28T07:57:44Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Question to the experienced members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Question to the experienced members==&lt;br /&gt;
I already found out, that when I select the This is a minor change Check box, my contributions are marked with the symbol m. I will keep doing this until my [[Cookie Warning Tutorial]] is ready to be reviewed.&lt;br /&gt;
&lt;br /&gt;
And while you are at it, is my writing style etc. OK?&lt;br /&gt;
&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 01:07, 28 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Welcome to the volunteers==&lt;br /&gt;
You can create and publish a new page, just like in any wiki.&lt;br /&gt;
&lt;br /&gt;
MarkRS has already shown you, what I think is the wrong way, to contribute here. &lt;br /&gt;
&lt;br /&gt;
I have had quite different experiences than MarkRS. I do not know his attempts to establish contacts. However, I started with translations first. A good way to communicate at this time is Glip (there are some plans to switch to another service provider).&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/RingCentral_(Glip)&lt;br /&gt;
&lt;br /&gt;
Your own userspace is excellent as a playground to test the design of a new page, but is fundamentally unsuitable to bring the Joomla documentation forward.&lt;br /&gt;
In the Joomla documentation there are a lot of &amp;quot;style guides&amp;quot; which support you and help to avoid unnecessary errors:&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/Category:Documentation_Wiki_Information&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/Portal:Participating_in_the_Community&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/JDOC:How_to_Contribute_to_Joomla!_Documentation&lt;br /&gt;
&lt;br /&gt;
If you have specific questions, then contact one of the administrators:&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/Special:ListUsers?username=&amp;amp;group=sysop&amp;amp;wpsubmit=&amp;amp;wpFormIdentifier=mw-listusers-form&amp;amp;limit=500&lt;br /&gt;
&lt;br /&gt;
You can find the contact data either on the JDOC user pages (please click the name) or in the &amp;quot;Joomla! Volunteers Portal&amp;quot; in the tab &amp;quot;Joomlers&amp;quot;. A separate registration is necessary there.&amp;lt;/br&amp;gt;&lt;br /&gt;
BTW: The user &amp;quot;M-b-o&amp;quot; (Mike Brander) is the current &amp;quot;Teamlead Joomla Documentation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[User:Max123kl|Max123kl]] ([[User talk:Max123kl|talk]]) 07:36, 27 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
===I already started writing my tutorial===&lt;br /&gt;
You may find it under /Cookie_Warning_Tutorial&lt;br /&gt;
&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 11:03, 27 October 2022 (CDT)&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993368</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993368"/>
		<updated>2022-10-28T07:45:13Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a button to hide the message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====This page is under construction. Please do not modify until this line is removed.====&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 02:24, 28 October 2022 (CDT)&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for and users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
* Click Custom to create a Custom Site Module.&lt;br /&gt;
* Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
* In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
* Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
* Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
* Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML source code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message (Maybe a Carrige Return is needet to open a new line.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Now click Toggle Editor again and the I accept button should be visible. (If it looks ugly, the editor is not using Bootstrap)&lt;br /&gt;
* Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
* Now switch to the browser window viewing the site view and refresh. You should not only see the warning, but also the button.&lt;br /&gt;
&lt;br /&gt;
After clicking the button ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993367</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993367"/>
		<updated>2022-10-28T07:31:10Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a Site Module for the warning message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====This page is under construction. Please do not modify until this line is removed.====&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 02:24, 28 October 2022 (CDT)&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for and users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
* Click Custom to create a Custom Site Module.&lt;br /&gt;
* Enter a Module Title (for Example: Cookie Warning).&lt;br /&gt;
* In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
* Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
* Select to publish the warning. (If later anything gets messed up, just unpublish the module. Only published components are seen by end users.)&lt;br /&gt;
* Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarnung&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now click Toggle Editor again and the accept button should be visible. (It looks ugly, but the reason is, that the editor is not using Bootstrap)&lt;br /&gt;
Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
Now swich to the browser viewing to the site view and refresh. You should not only see the warning, but also the button. After clicking it ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993366</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993366"/>
		<updated>2022-10-28T07:24:06Z</updated>

		<summary type="html">&lt;p&gt;Richard123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====This page is under construction. Please do not modify until this line is removed.====&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 02:24, 28 October 2022 (CDT)&lt;br /&gt;
==Abstract==&lt;br /&gt;
This tutorial guides new Joomla administrators step-by-step through the implementation of a Custom Site Module. Along the way, simple HTML, CSS, JavaScript and testing options are explained.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created. The page [[Cookie notification]] explains what a cookie is.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it might be necessary to provide appropriate notices. Joomla itself does not offer such a feature.&lt;br /&gt;
&lt;br /&gt;
A simple option would be to install one of the many Joomla extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
===The installation of extensions bears certain risks===&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How does the extension influence the rest of the system?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks would not exist creating an own cookie warning. Moreover, full control and learning a lot about Joomla, HTML, CSS and JavaScript would be the outcome.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum, which is the default backend template for Joomla 4. (This tutorial should also be suitable for older Joomla versions, but is not tested in this context.)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed. This means that the end user interface is Cassiopeia, the default site template for and users and Joomla 4.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks. That way restoring the original state.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
*Click Custom&lt;br /&gt;
*Enter a Module Title (for Example: Cookie Warning)&lt;br /&gt;
*In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
*Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
*Select to publish the warning. (If later anything gets messed up, just unpublish the module)&lt;br /&gt;
*Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarnung&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now click Toggle Editor again and the accept button should be visible. (It looks ugly, but the reason is, that the editor is not using Bootstrap)&lt;br /&gt;
Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
Now swich to the browser viewing to the site view and refresh. You should not only see the warning, but also the button. After clicking it ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Richard123&amp;diff=993365</id>
		<title>User talk:Richard123</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Richard123&amp;diff=993365"/>
		<updated>2022-10-28T06:07:21Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Welcome to the volunteers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Question to the experienced members==&lt;br /&gt;
Is that right, that when I modify a page and select the This is a minor edit checkbox before saving the changes, that you do not get alerted? I am asking because I do not want to disturb with every check-in until the first final version of the /Cookie_Warning_Tutorial is ready to be reviewed.&lt;br /&gt;
&lt;br /&gt;
And while you are at it, is my writing style etc. OK?&lt;br /&gt;
&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 01:07, 28 October 2022 (CDT)&lt;br /&gt;
==Welcome to the volunteers==&lt;br /&gt;
You can create and publish a new page, just like in any wiki.&lt;br /&gt;
&lt;br /&gt;
MarkRS has already shown you, what I think is the wrong way, to contribute here. &lt;br /&gt;
&lt;br /&gt;
I have had quite different experiences than MarkRS. I do not know his attempts to establish contacts. However, I started with translations first. A good way to communicate at this time is Glip (there are some plans to switch to another service provider).&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/RingCentral_(Glip)&lt;br /&gt;
&lt;br /&gt;
Your own userspace is excellent as a playground to test the design of a new page, but is fundamentally unsuitable to bring the Joomla documentation forward.&lt;br /&gt;
In the Joomla documentation there are a lot of &amp;quot;style guides&amp;quot; which support you and help to avoid unnecessary errors:&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/Category:Documentation_Wiki_Information&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/Portal:Participating_in_the_Community&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/JDOC:How_to_Contribute_to_Joomla!_Documentation&lt;br /&gt;
&lt;br /&gt;
If you have specific questions, then contact one of the administrators:&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/Special:ListUsers?username=&amp;amp;group=sysop&amp;amp;wpsubmit=&amp;amp;wpFormIdentifier=mw-listusers-form&amp;amp;limit=500&lt;br /&gt;
&lt;br /&gt;
You can find the contact data either on the JDOC user pages (please click the name) or in the &amp;quot;Joomla! Volunteers Portal&amp;quot; in the tab &amp;quot;Joomlers&amp;quot;. A separate registration is necessary there.&amp;lt;/br&amp;gt;&lt;br /&gt;
BTW: The user &amp;quot;M-b-o&amp;quot; (Mike Brander) is the current &amp;quot;Teamlead Joomla Documentation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[User:Max123kl|Max123kl]] ([[User talk:Max123kl|talk]]) 07:36, 27 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
===I already started writing my tutorial===&lt;br /&gt;
You may find it under /Cookie_Warning_Tutorial&lt;br /&gt;
&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 11:03, 27 October 2022 (CDT)&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993288</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993288"/>
		<updated>2022-10-27T16:54:58Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a button to hide the message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is under construction. Please do not modify until this line is removed.&lt;br /&gt;
&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it is necessary to provide appropriate notices.&lt;br /&gt;
&lt;br /&gt;
A simple option is to install one of the many extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this simple option hides certain risks.&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks do not exist if you create your own cookie warning. Moreover, you have full control and learn a lot about Joomla, HTML, CSS and JavaScript.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum. (This is the default interface)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
*Click Custom&lt;br /&gt;
*Enter a Module Title (for Example: Cookie Warning)&lt;br /&gt;
*In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
*Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
*Select to publish the warning. (If later anything gets messed up, just unpublish the module)&lt;br /&gt;
*Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarnung&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=accepted;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=accepted&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now click Toggle Editor again and the accept button should be visible. (It looks ugly, but the reason is, that the editor is not using Bootstrap)&lt;br /&gt;
Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
Now swich to the browser viewing to the site view and refresh. You should not only see the warning, but also the button. After clicking it ...&lt;br /&gt;
&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993287</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993287"/>
		<updated>2022-10-27T16:52:21Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Debugging the Cookie Warning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is under construction. Please do not modify until this line is removed.&lt;br /&gt;
&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it is necessary to provide appropriate notices.&lt;br /&gt;
&lt;br /&gt;
A simple option is to install one of the many extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this simple option hides certain risks.&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks do not exist if you create your own cookie warning. Moreover, you have full control and learn a lot about Joomla, HTML, CSS and JavaScript.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum. (This is the default interface)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
*Click Custom&lt;br /&gt;
*Enter a Module Title (for Example: Cookie Warning)&lt;br /&gt;
*In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
*Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
*Select to publish the warning. (If later anything gets messed up, just unpublish the module)&lt;br /&gt;
*Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarnung&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=akzeptiert;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=akzeptiert&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now click Toggle Editor again and the accept button should be visible. (It looks ugly, but the reason is, that the editor is not using Bootstrap)&lt;br /&gt;
Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
Now swich to the browser viewing to the site view and refresh. You should not only see the warning, but also the button. After clicking it ...&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
===Before debugging, take a brief look at what the code is doing===&lt;br /&gt;
*There is a HTML button tag with the attribute class=&amp;quot;btn btn-primary&amp;quot; (these classes are used by bootstrap to format a nice button in the primary color).&lt;br /&gt;
*Following is an onclick=&amp;quot;&amp;quot; attribute.&lt;br /&gt;
*There are two JavaScript commands, each terminated with a semicolon &amp;quot;;&amp;quot; inside of the onclick attribute.&lt;br /&gt;
*The first statement finds the HTML Tag with the ID #cookieWarning and gives it a CSS style of display: none; (it is in single quotes, because die double quotes are already used by the onclick=&amp;quot;&amp;quot; surrounding it.&lt;br /&gt;
*The second statement sets a cookie in the clients browser with the content accepted.&lt;br /&gt;
*Last, the button gets a label of I accept and the HTML closing tag for the button.&lt;br /&gt;
So when the button is clicked by the end user, it finds the container of the Cookie Warning by looking for its ID, hides this from the user and than sets a marker in the uses browser to remember that he accepted the cookies.&lt;br /&gt;
&lt;br /&gt;
The next part is a HTML tag which includes JavaScript. It is executed every time the brouser wants to display the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
*The starting HTML &amp;lt;script&amp;gt; tag.&lt;br /&gt;
*An if statement which test in the round brackets ()&lt;br /&gt;
*It tests for a cookie in the browser of the end user which says accepted.&lt;br /&gt;
*If that cookie exists, it executes the commands in the curly brackets.&lt;br /&gt;
*And that command wie already know. Hide the Cookie Warning.&lt;br /&gt;
&lt;br /&gt;
So what all of this is doing: If there is no cookie in the end users browser, it displays the warning on every page displayed. If somewhen the user gets bored and clicks the button it hides the warning and remembers to hide it everytime the end user is visiting the website.&lt;br /&gt;
===Now start debugging===&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Richard123&amp;diff=993286</id>
		<title>User talk:Richard123</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Richard123&amp;diff=993286"/>
		<updated>2022-10-27T16:03:48Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Welcome to the volunteers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Welcome to the volunteers==&lt;br /&gt;
You can create and publish a new page, just like in any wiki.&lt;br /&gt;
&lt;br /&gt;
MarkRS has already shown you, what I think is the wrong way, to contribute here. &lt;br /&gt;
&lt;br /&gt;
I have had quite different experiences than MarkRS. I do not know his attempts to establish contacts. However, I started with translations first. A good way to communicate at this time is Glip (there are some plans to switch to another service provider).&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/RingCentral_(Glip)&lt;br /&gt;
&lt;br /&gt;
Your own userspace is excellent as a playground to test the design of a new page, but is fundamentally unsuitable to bring the Joomla documentation forward.&lt;br /&gt;
In the Joomla documentation there are a lot of &amp;quot;style guides&amp;quot; which support you and help to avoid unnecessary errors:&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/Category:Documentation_Wiki_Information&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/Portal:Participating_in_the_Community&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/JDOC:How_to_Contribute_to_Joomla!_Documentation&lt;br /&gt;
&lt;br /&gt;
If you have specific questions, then contact one of the administrators:&amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.joomla.org/Special:ListUsers?username=&amp;amp;group=sysop&amp;amp;wpsubmit=&amp;amp;wpFormIdentifier=mw-listusers-form&amp;amp;limit=500&lt;br /&gt;
&lt;br /&gt;
You can find the contact data either on the JDOC user pages (please click the name) or in the &amp;quot;Joomla! Volunteers Portal&amp;quot; in the tab &amp;quot;Joomlers&amp;quot;. A separate registration is necessary there.&amp;lt;/br&amp;gt;&lt;br /&gt;
BTW: The user &amp;quot;M-b-o&amp;quot; (Mike Brander) is the current &amp;quot;Teamlead Joomla Documentation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[User:Max123kl|Max123kl]] ([[User talk:Max123kl|talk]]) 07:36, 27 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
===I already started writing my tutorial===&lt;br /&gt;
You may find it under /Cookie_Warning_Tutorial&lt;br /&gt;
&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 11:03, 27 October 2022 (CDT)&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993285</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993285"/>
		<updated>2022-10-27T15:19:11Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* A big warning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is under construction. Please do not modify until this line is removed.&lt;br /&gt;
&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it is necessary to provide appropriate notices.&lt;br /&gt;
&lt;br /&gt;
A simple option is to install one of the many extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this simple option hides certain risks.&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks do not exist if you create your own cookie warning. Moreover, you have full control and learn a lot about Joomla, HTML, CSS and JavaScript.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum. (This is the default interface)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
*Click Custom&lt;br /&gt;
*Enter a Module Title (for Example: Cookie Warning)&lt;br /&gt;
*In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
*Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
*Select to publish the warning. (If later anything gets messed up, just unpublish the module)&lt;br /&gt;
*Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarnung&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=akzeptiert;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=akzeptiert&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now click Toggle Editor again and the accept button should be visible. (It looks ugly, but the reason is, that the editor is not using Bootstrap)&lt;br /&gt;
Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
Now swich to the browser viewing to the site view and refresh. You should not only see the warning, but also the button. After clicking it ...&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template installed always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993284</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993284"/>
		<updated>2022-10-27T15:17:34Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Debugging the Cookie Warning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is under construction. Please do not modify until this line is removed.&lt;br /&gt;
&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it is necessary to provide appropriate notices.&lt;br /&gt;
&lt;br /&gt;
A simple option is to install one of the many extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this simple option hides certain risks.&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks do not exist if you create your own cookie warning. Moreover, you have full control and learn a lot about Joomla, HTML, CSS and JavaScript.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum. (This is the default interface)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
*Click Custom&lt;br /&gt;
*Enter a Module Title (for Example: Cookie Warning)&lt;br /&gt;
*In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
*Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
*Select to publish the warning. (If later anything gets messed up, just unpublish the module)&lt;br /&gt;
*Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarnung&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=akzeptiert;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=akzeptiert&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now click Toggle Editor again and the accept button should be visible. (It looks ugly, but the reason is, that the editor is not using Bootstrap)&lt;br /&gt;
Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
Now swich to the browser viewing to the site view and refresh. You should not only see the warning, but also the button. After clicking it ...&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class named cookieWarning!&lt;br /&gt;
&lt;br /&gt;
That is easy to solve:&lt;br /&gt;
*Open up the Site Module Cookie Warning again, if it is not still open.&lt;br /&gt;
*Select the Advanced tab.&lt;br /&gt;
*In the Module Class field enter cookieWarning&lt;br /&gt;
*Save the changes.&lt;br /&gt;
*Refresh your browser.&lt;br /&gt;
&lt;br /&gt;
Now it should work! Great!&lt;br /&gt;
===A big warning===&lt;br /&gt;
There are templates out there which do not take all those attributes and convert it into HTML. That means, if you are using such templates you might get alot of trouble debugging your code and the template is just not showing it to the browser.&lt;br /&gt;
&lt;br /&gt;
If you have a add-on template insstalled always have a hidden menu by hand (a menue which is defined and has at least one Menu Item), but which is not connected to any Template Position. (And therefore not shown on the website) Then have this Menu Item displayed in the Cassiopeia template. By typing the Alias of this Menu Item behind the domain name in the browsers address field, it is always possible to access this testpage with Cassiopeia template for debugging.&lt;br /&gt;
==To be continued==&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993283</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993283"/>
		<updated>2022-10-27T14:54:34Z</updated>

		<summary type="html">&lt;p&gt;Richard123: /* Create a Site Module for the warning message */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is under construction. Please do not modify until this line is removed.&lt;br /&gt;
&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it is necessary to provide appropriate notices.&lt;br /&gt;
&lt;br /&gt;
A simple option is to install one of the many extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this simple option hides certain risks.&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks do not exist if you create your own cookie warning. Moreover, you have full control and learn a lot about Joomla, HTML, CSS and JavaScript.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum. (This is the default interface)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
*Click Custom&lt;br /&gt;
*Enter a Module Title (for Example: Cookie Warning)&lt;br /&gt;
*In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
*Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
*Select to publish the warning. (If later anything gets messed up, just unpublish the module)&lt;br /&gt;
*Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;br /&gt;
==Create a button to hide the message==&lt;br /&gt;
The way the Cookie Warning works by now is, that it is shown on every page. So lets add a button to hide the message.&lt;br /&gt;
*Open the Site Module again under Content -&amp;gt; Site Modules -&amp;gt; Cookie Warning&lt;br /&gt;
*Below the editor field click the button Toggle Editor to switch the editor to display the HTML code of the cookie warning&lt;br /&gt;
*Now take the following code snippet and insert it below the existing message&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;button class=&amp;quot;btn btn-primary&amp;quot; onclick=&amp;quot;&lt;br /&gt;
  document.getElementById(&#039;cookieWarnung&#039;).style.display=&#039;none&#039;;&lt;br /&gt;
  document.cookie=&#039;cookies=akzeptiert;max-age=315360000;path=/;&#039;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I accept&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
   if (document.cookie == &#039;cookies=akzeptiert&#039;)&lt;br /&gt;
      {document.getElementById(&#039;cookieWarning&#039;).style.display=&#039;none&#039;;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now click Toggle Editor again and the accept button should be visible. (It looks ugly, but the reason is, that the editor is not using Bootstrap)&lt;br /&gt;
Click Save at the top of the page to store the change without closing the Modules: Custom page.&lt;br /&gt;
Now swich to the browser viewing to the site view and refresh. You should not only see the warning, but also the button. After clicking it ...&lt;br /&gt;
==Debugging the Cookie Warning==&lt;br /&gt;
What happend? Nothing? Shouldn&#039;t the warning disappear when the button is clicked?&lt;br /&gt;
&lt;br /&gt;
So in the browser open the developer tools. In firefox that is Shift+Ctrl+I. In the Inspector tab search for Cookie Warning. Check if the title, the message, the button and the script tag are all there. Should be fine.&lt;br /&gt;
&lt;br /&gt;
Now check if the class cookieWarning is used. -- Ups, all kinds of classes, but no class name cookieWarning!&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993282</id>
		<title>J4.x:Cookie Warning Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Cookie_Warning_Tutorial&amp;diff=993282"/>
		<updated>2022-10-27T13:01:00Z</updated>

		<summary type="html">&lt;p&gt;Richard123: Created page with &amp;quot;This page is under construction. Please do not modify until this line is removed.  In some countries, there are legal requirements to issue a warning on websites when cookies...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is under construction. Please do not modify until this line is removed.&lt;br /&gt;
&lt;br /&gt;
In some countries, there are legal requirements to issue a warning on websites when cookies are created.&lt;br /&gt;
 &lt;br /&gt;
Joomla automatically creates such cookies to track the session of visitors. Therefore, it is necessary to provide appropriate notices.&lt;br /&gt;
&lt;br /&gt;
A simple option is to install one of the many extensions that offer to present such a warning.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this simple option hides certain risks.&lt;br /&gt;
&lt;br /&gt;
* What exactly is being installed?&lt;br /&gt;
* How to remove the extension if it does not suit?&lt;br /&gt;
* Is there an uninstall function and is it complete or does it leave residues that affect the system?&lt;br /&gt;
* Does the extension even do something else that is not wanted?&lt;br /&gt;
&lt;br /&gt;
All these risks do not exist if you create your own cookie warning. Moreover, you have full control and learn a lot about Joomla, HTML, CSS and JavaScript.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that Joomla version 4 is installed and the administrator has a rough overview of the administration interface Atum. (This is the default interface)&lt;br /&gt;
&lt;br /&gt;
Even though there are not so many differences in the procedure, this tutorial assumes that no extensions are installed.&lt;br /&gt;
&lt;br /&gt;
Presumably there is already a main menu and a few articles. (In a very fresh test installation the sample data could be installed).&lt;br /&gt;
&lt;br /&gt;
Beginners don&#039;t have to worry, everything that is created can be deactivated and also deleted with a few mouse clicks.&lt;br /&gt;
&lt;br /&gt;
So no more foreplay, let&#039;s get started.&lt;br /&gt;
&lt;br /&gt;
==Create a Site Module for the warning message==&lt;br /&gt;
In administrator interface click Contents and besides Site Modules click the + sign. Or click Site Modules and then click New. This starts creation of a new module.&lt;br /&gt;
*Click Custom&lt;br /&gt;
*Enter a Module Title (for Example: Cookie Warning)&lt;br /&gt;
*In the editor field write a message. Let&#039;s start with: By using this site you accept cookies! (We are going to enhance this later)&lt;br /&gt;
*Flip the switch Title to Hide&lt;br /&gt;
*Select the Position main-top (That would be right under the page header before the content)&lt;br /&gt;
*Select to publish the warning. (If later anything gets messed up, just unpublish the module)&lt;br /&gt;
*Leave everything else in it&#039;s default settings and click Save &amp;amp; Close at the top of the page&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. We have our warning. After opening the site view of the Joomla Website in a new browser window the warning should be displayed.&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Richard123&amp;diff=993274</id>
		<title>User:Richard123</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Richard123&amp;diff=993274"/>
		<updated>2022-10-27T11:34:15Z</updated>

		<summary type="html">&lt;p&gt;Richard123: Created page with &amp;quot;Welcome to my user profile.  My name is Richard, I am using Joomla since 2016 for my company website. Before joining the Joomla Family I tried alot of other major web framewor...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to my user profile.&lt;br /&gt;
&lt;br /&gt;
My name is Richard, I am using Joomla since 2016 for my company website.&lt;br /&gt;
Before joining the Joomla Family I tried alot of other major web frameworks.&lt;br /&gt;
&lt;br /&gt;
Joomla convinced me because it is flexible for all kinds of task. Besides that the implemented MVC concept seemed to be good supported. Seemed, because the out of the box site templates really try to keep any controler functionallity out.&lt;br /&gt;
&lt;br /&gt;
I later found out that this only applies to the templates provided in the installation package. All major template provider do exactly the opposite. They pack as much additional functionality into their templates as possible. I in fact can only guess what their reasons for doing so are...&lt;br /&gt;
&lt;br /&gt;
Anyways, I sticked to Joomla, short time ago upgraded to J4 and am happy with the evolution (however, a lot of patience was required).&lt;br /&gt;
&lt;br /&gt;
To give some of my experience back to the community I just joined the Joomla documentation site.&lt;br /&gt;
&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 06:34, 27 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
As you might tell already, I like to write ;-)&lt;br /&gt;
And I am always interested in free html, css, scss only templates. Maybe with JavaScript or a Design Framework like Bootstrap.&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=JDOC_talk:Joomla_4_Tutorials_Project&amp;diff=993273</id>
		<title>JDOC talk:Joomla 4 Tutorials Project</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=JDOC_talk:Joomla_4_Tutorials_Project&amp;diff=993273"/>
		<updated>2022-10-27T10:30:19Z</updated>

		<summary type="html">&lt;p&gt;Richard123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Sorry for contacting this way, I did not find any other way.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I registered to contribute a simple tutorial on how to implement a cookie warning as a custom site plugin, without installing any extensions. Besides getting the cookie warning up and running, such a tutorial would demonstrate how simple it is to extend Joomla without modifying template sources or installing anything (both might scare newbees).&lt;br /&gt;
&lt;br /&gt;
I did not find a way to add a new tutorial though. May anyone give advice on how to get started? Later I could also write a tutorial on how to get involved in writing tutorials ;-)&lt;br /&gt;
&lt;br /&gt;
Thanks, Richard&lt;br /&gt;
&lt;br /&gt;
[[User:Richard123|Richard123]] ([[User talk:Richard123|talk]]) 05:30, 27 October 2022 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[User:GregJPreece|GregJPreece]] ([[User talk:GregJPreece|talk]]) 21:01, 3 January 2020 (CST) MVC Component Tutorial&lt;br /&gt;
&lt;br /&gt;
I&#039;ve been considering rewriting the component tutorial for Joomla 3.x, as many elements of it need modernising, and I really don&#039;t like the way it still uses legacy class names. If J4 is on the way and needs a similar tutorial, it seems sensible to start there.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
Yes, please do. I’ve been holding off working my way through it as it seamed dated to a degree.&lt;br /&gt;
&lt;br /&gt;
If you want a reviewer for the changes, I’d be up for it.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
Cool, thank you. I&#039;ll get started soon. My first component is making its way into the JED right now, so I&#039;ll be working on J4 compatibility for that in the next release. I&#039;ll write the docs here as I go.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
Great - I look forward to helping out!&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
How&#039;s this progressing? It&#039;s a page I (desperately) need, so I would be willing to help, if that&#039;s of any use.&lt;br /&gt;
I decided my next project would be a handy way to get into J4... so here I am, desperate.&lt;br /&gt;
[[User:MarkRS|MarkRS]] ([[User talk:MarkRS|talk]]) 15:32, 8 September 2020 (CDT)&lt;/div&gt;</summary>
		<author><name>Richard123</name></author>
	</entry>
</feed>