User Defined Tags not working?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
TheLastLegion
Forum Members
Forum Members
Posts: 54
Joined: Sun Dec 21, 2008 4:01 am

User Defined Tags not working?

Post by TheLastLegion »

I've CMS Made Simple 1.5.1 Base version
I'm using PHP 5.2.6 & MySQL 5.0.67-community with Apache 2.2

Ok so in admin panel i went to Extensions -> User Defined Tags and clicked add new user-defined tag

for tag name i put in gmember and for code i put in:

Code: Select all

<!-- Include the Google Friend Connect javascript library. -->
<__script__ type="text/javascript" src="http://www.google.com/friendconnect/script/friendconnect.js"></__script>

<!-- Define the div tag where the gadget will be inserted. -->
<div id="div-1229831595266" style="width:200px;border:1px solid #ffffff;"></div>
<!-- Render the gadget into a div. -->
<__script__ type="text/javascript">
var skin = {};
skin['HEIGHT'] = '385';
skin['BORDER_COLOR'] = '#ffffff';
skin['ENDCAP_BG_COLOR'] = '#ffffff';
skin['ENDCAP_TEXT_COLOR'] = '#333333';
skin['ENDCAP_LINK_COLOR'] = '#0000cc';
skin['ALTERNATE_BG_COLOR'] = '#ffffff';
skin['CONTENT_BG_COLOR'] = '#ffffff';
skin['CONTENT_LINK_COLOR'] = '#0000cc';
skin['CONTENT_TEXT_COLOR'] = '#333333';
skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';
skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
skin['CONTENT_HEADLINE_COLOR'] = '#333333';
google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html and canvas.html */);
google.friendconnect.container.renderMembersGadget(
 { id: 'div-1229831595266',
   site: '11664437414973744958'},
  skin);
</__script>

When i pressed submit i got this error:
Invalid code entered.
Parse error: syntax error, unexpected '<' in /home/stanleyu/public_html/admin/adduserplugin.php(100) : eval()'d code on line 1
So i thouht i probably uploaded adduserplugin.php wrongly and re-uploaded it and still the same error, is the user-defined tags just for PHP codes only??

Assuming that i went to Content in dashboard and clicked on Global Content Blocks, and added name gmember and the same code as before. this time it worked and it gave me this tag to insert into my templates:
"{global_content name='gmember'}"
so i did that and the first thing i see after i hit submit and viewed my homepage was this error:

Code: Select all

string(119) "Smarty error: [in globalcontent:gmember line 8]: syntax error: unrecognized tag: (Smarty_Compiler.class.php, line 446)" string(120) "Smarty error: [in globalcontent:gmember line 8]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(177) "Smarty error: [in globalcontent:gmember line 23]: syntax error: unrecognized tag: id: 'div-1229831595266', site: '11664437414973744958' (Smarty_Compiler.class.php, line 446)" string(121) "Smarty error: [in globalcontent:gmember line 23]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
is this a smarty error? the codes are from Google Friend Connect script..

Also i've some questions about using some things/fixing up some things according to my template, is this also the right section to post that?
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: User Defined Tags not working?

Post by Nullig »

In the GCB, you should surround the script with smarty tags {literal} ...script here... {/literal}.

Nullig
TheLastLegion
Forum Members
Forum Members
Posts: 54
Joined: Sun Dec 21, 2008 4:01 am

Re: User Defined Tags not working?

Post by TheLastLegion »

Thanks for the quick reply, i did what you told me exactly here is the new updated code:

Code: Select all

{literal} <!-- Include the Google Friend Connect javascript library. -->
<__script__ src="http://www.google.com/friendconnect/script/friendconnect.js" type="text/javascript"></__script>
<!-- Define the div tag where the gadget will be inserted. --> <!-- Render the gadget into a div. -->
<__script__ type="text/javascript"><!--
var skin = {};
skin['HEIGHT'] = '385';
skin['BORDER_COLOR'] = '#ffffff';
skin['ENDCAP_BG_COLOR'] = '#ffffff';
skin['ENDCAP_TEXT_COLOR'] = '#333333';
skin['ENDCAP_LINK_COLOR'] = '#0000cc';
skin['ALTERNATE_BG_COLOR'] = '#ffffff';
skin['CONTENT_BG_COLOR'] = '#ffffff';
skin['CONTENT_LINK_COLOR'] = '#0000cc';
skin['CONTENT_TEXT_COLOR'] = '#333333';
skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';
skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
skin['CONTENT_HEADLINE_COLOR'] = '#333333';
google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html and canvas.html */);
google.friendconnect.container.renderMembersGadget(
 { id: 'div-1229831595266',
   site: '11664437414973744958'},
  skin);
// --></__script>
{/literal}

The tag that was generated for me to use was:

Code: Select all

{global_content name='gmember'}
The url it should appear is: http://stanley.uk.to
I used that and on the front-page as you can see, its blank.. whats supposed to appear is the Google's Friend Connect feature



Please let me know if you need screen-shots or anything specific that might help solve this problem
TheLastLegion
Forum Members
Forum Members
Posts: 54
Joined: Sun Dec 21, 2008 4:01 am

Re: User Defined Tags not working?

Post by TheLastLegion »

UPDATE: Problem fixed i got it thanks

i've another question though in mind,
i'm using a custom template, and on my navigation bar i've replaced the menus ul and li with
{cms_module module="menumanager"}
however it seems menumanager is using it's own stylesheet, how can i get menumanager to use the overall site stylesheet as it contains the css for the menus in there as well?

Also i've noticed the menus say "Current page is 1: Home" and its not hyperlinked.. is that normal?
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: User Defined Tags not working?

Post by Nullig »

Menu manager applies specific ids and classes to the menu items. You should look at the generated page to see what they are, then add the styles you want using those ids and classes.

You need to attach the "accessibility and cross browser tools" stylesheet to your template, to eliminate the numbering.

Nullig
TheLastLegion
Forum Members
Forum Members
Posts: 54
Joined: Sun Dec 21, 2008 4:01 am

Re: User Defined Tags not working?

Post by TheLastLegion »

o i see, looking at the frontpage's page source code, i see the following:

Code: Select all

<div id="menu"> 
 
 
<ul> 
 
<li class="currentpage"><h3><dfn>Current page is 1: </dfn>Home</h3> 
 
 
</li> 
</ul> 
 
</div> 
I've searched for this "currentpage" on Accessibility and cross-browser tools stylesheet and couldn't find this in Navigation: Simple - Vertical stylesheet either

the link now says "Home" but it is not hyperlinked, is that normal or because i've not added any other pages?

from my style-sheet what i'd like to add is:

Code: Select all

#menu {height: 30px;
line-height: 30px;
background: #000;}

#menu ul {list-style-type: none;
padding-left: 30px;}

#menu ul li {display: block;
float: left;}

#menu ul li a {padding: 0 20px 0 0;
text-decoration: none;
font-weight: 600;
font-size: 12px;
color: #fff;}

#menu ul li a:hover {color: #aaa;
text-decoration: none;}
update:
so what i've done is i went to Layout - > Menu Manager
and created a new template from minimal_menu.tpl and called it minimial
and in this template i added my above #menu css codes, it said .currentpage is for active current page, but my menu uses a div tag so i guessed the "#" had to follow through and not use the "."


then i went back to my main website template and did this:

Code: Select all

<div id="menu">
{menu template='minimial.tpl'}
{cms_module module="menumanager"}
</div>
however after saving and refreshing i saw this:

Code: Select all

string(81) "Smarty error: unable to read resource: "module_file_tpl:MenuManager;minimial.tpl""
in the nav bar
Post Reply

Return to “CMSMS Core”