We continue the series of articles on the topic of working with standard templates of the uCoz constructor.
With the help of these materials, novice users of our system who want to slightly update and customize their site will be able to do this themselves, without resorting to the services of freelancers..
Before you start updating your site, be sure to back up all templates as instructed .
Block personalization. Why?
You often ask us on social networks how to make site content united states of america phone number resource available only after registration. This is one of the applications. Another popular technique is a personal greeting for each user group on the site.
In both cases, the system code $GROUP_ID$ will help to implement the plan .
Example of implementation
As an example, we will hide the block with site statistics from guests.
To find the site statistics block code in the control panel, go to the “Global Blocks” section (Control Panel → Design → Editor).
Depending on how many columns your template contains, the code may be located either in a global block called "First Container" (as in my case) or "Second Container" (if the template has three columns).
For convenience, each block is separated from the others by the markup here N is the block number.
Information that relates to the block content (we will leave the block title and its design unchanged in this case) is located between the markup <!-- <bc> -->...<!-- </bc> --> .
To prevent guests from viewing statistics, we need to find out the ID of the guest category on the site (Control Panel → Users → Groups). Here we see that guests have ID 0.
Open the global blocks and add the following condition:
The section of code we added is highlighted in red. Note the closing condition at the end of the line.
You can read more about how conditional operators work directly in the control panel.
We save the template changes, go to the site as guests and see the result.
Please note : as an example, we have hidden the "Who is online" statistics from guests along with the $COUNTER$ statistics counter . In reality, this should not be done, otherwise the counter will not count visits from those who are not registered on the site.
Read also:
Modifying the default website template. Part 1: working with color
global blocks , template customization , conditional operators , uCoz , instruction
6 comments
The order of displaying comments:
By default
1
1 Written by MarkoMarko
Thank you, it's useful! To display information to guests, you can also use the code $USER_LOGGED_IN$ or $LOGIN_LINK$
0
2 Written by olepav
Yes, in the case of guests there are several options to filter them at oncesmile
Spam
1
3 Posted by e-orlando January 29, 2019, 10:25 PM
Hello thanks a lot for support uCoz, but Could you please check Facebook Login with social login? try to login with facebook and you'll see that it is failing on all uCoz Website, I contacted to facebook and they said that I must contact to you, and I repeat this is not happening only on my website if you try to login with facebook on all ucoz website it will fail (you can even try to login on this blog with facebook and you'll see a red warning).
Modifying the default website template. Part 2: personalized blocks
-
- Posts: 36
- Joined: Thu Dec 05, 2024 4:58 am