Forum moderator: bigblog  
uCoz Community » For Webmasters » Design Customization » Global Blocks (tutorial and FAQ)
Global Blocks
Sunny
Posts: 9296
Reputation: 456

Message # 1 | 2:04 PM
Global blocks are blocks available in all templates of your website. By means of global blocks you can optimize the design of your website, having splitted it into common parts. With the help of common blocks you can update the design on the whole website by means of editing only one block template.


Where to create a global block in the Control Panel:


Go to Customize Design -> Global blocks.



Click New block.



Enter a block name (let it be LINKS in our case) and click Add.



A block name must contain only uppercase Latin letters, max length is 10 characters. This name will serve as the $code$ of the given global block in templates.


A new block will be added to the list. In our case it is $GLOBAL_LINKS$.



Go to Control Panel -> Customize Design and find the block template on the list of templates under Global blocks.



Add any code you need to the template, save it, and paste its $code$ (e.g. $GLOBAL_LINKS$) into the templates where you want it to be displayed.

Max number of global blocks is 10, including the 4 default blocks ($GLOBAL_AHEADER$, $GLOBAL_BFOOTER$, $GLOBAL_CLEFTER$, $GLOBAL_DRIGHTER$). The number of default blocks differs in different designs, some templates have only 3.

Note: If you are going to edit templates you must have basic knowledge of HTML and CSS.


Question-Answer


How can I add a global block in a global block?

You can't... we don't support global blocks nesting.

I've noticed the global block $GLOBAL_SOANDSO$ will not run inside the $CONTENT$ area.
Correct me if am wrong!


You are right. Global blocks work in templates only

Just 10 global blocks?

10 is the limit, you can't create more global blocks.
Attachments: 1514136.png (26.8 Kb) · 8639095.png (22.1 Kb) · 7644645.png (25.3 Kb) · 4539422.png (26.7 Kb) · 3073300.png (25.9 Kb)

I'm not active on the forum anymore. Please contact other forum staff.
noredtape
Posts: 2
Reputation: 0

Message # 31 | 0:15 AM
After copying Admin i will paste it in my global blocks in visual HTML editor?
Kron_old
Posts: 117
Reputation: 52

Message # 32 | 0:15 AM
noredtape, make a try
PurpleBisch
Posts: 22
Reputation: 0

Message # 33 | 4:51 AM
How can i make a global block on viewable to members who have logged in?
Sunny
Posts: 9296
Reputation: 456

Message # 34 | 8:45 AM
PurpleBisch, use conditional operators - http://forum.ucoz.com/forum/37-471-1
I'm not active on the forum anymore. Please contact other forum staff.
PurpleBisch
Posts: 22
Reputation: 0

Message # 35 | 2:21 PM
I can make it so the block says different things for if they are logged in or not, but i can't seem to make the box disappear if they aren't logged in
Armaros
Posts: 1424

Message # 36 | 10:16 PM
"Box" ? As in? The Block or Global Block?
PurpleBisch
Posts: 22
Reputation: 0

Message # 37 | 2:18 AM
yea. I want the global block to appear only when a user is logged in.
Armaros
Posts: 1424

Message # 38 | 2:18 AM
PurpleBisch, as Sunny said, use Conditional Operators - http://forum.ucoz.com/forum/37-471-1
PurpleBisch
Posts: 22
Reputation: 0

Message # 39 | 4:33 AM
It only tells me how i can change the text, i need to change the global block so its viewable only by members logged in >.<
Sunny
Posts: 9296
Reputation: 456

Message # 40 | 9:38 AM
PurpleBisch, it tells you all you need.

Code
<?if($USER_LOGGED_IN$)?>$global_block_code_here$<?endif?>

I'm not active on the forum anymore. Please contact other forum staff.
PurpleBisch
Posts: 22
Reputation: 0

Message # 41 | 2:49 PM
>.< somehow i skipped over that part. Thankyou smile
kibawe
Posts: 14
Reputation: -2

Message # 42 | 2:49 PM
ive noticed the global block $GLOBAL_SOANDSO$ will not run inside $CONTENT$ area.

correct me if am wrong!!!


Kron_old
Posts: 117
Reputation: 52

Message # 43 | 2:49 PM
Quote (kibawe)
correct me if am wrong!!!

you are right. global blocks work in templates only.
donmarius
Posts: 6
Reputation: 0

Message # 44 | 2:20 AM
hi, i redesign the logo for my site and i put the code in a global block, but when i tried to import the global block into my template nothing happened, it works only with the code, with global block nothing :(.

Code

<!-- <header> -->

$LOGOBIG$

<!-- </header> -->

Could be this because i use also in the gb this kind of code:

Code

$WDAY$, $DATE$, $TIME$<br>
<?if($USERS_ON$)?><?if($USER_LOGGED_IN$)?>
Esti <a href="$PERSONAL_PAGE_LINK$" title="Profilul tau"><b>$USERNAME$</b></a> | Grup: <u>$USER_GROUP$</u>
| <a href="$LOGOUT_LINK$"><b>Logout</b></a>
<?else?>
Buna <b>$USERNAME$</b><br>
$LOGIN_FORM$
<?endif?><?endif?>

Post edited by donmarius - Sunday, 2009-07-26, 2:21 AM
Sunny
Posts: 9296
Reputation: 456

Message # 45 | 9:01 AM
donmarius, where are you trying to put the global block code? Most probably your logo is in "Top part of the website" which is a global block also. And you can't put one block inside another block, therefore use the full code.
I'm not active on the forum anymore. Please contact other forum staff.
uCoz Community » For Webmasters » Design Customization » Global Blocks (tutorial and FAQ)
Search: