Support Forums

OK to Change Smarty Variables in Layout.tpl?

This is a discussion on OK to Change Smarty Variables in Layout.tpl? within the TemplateCodes forums, part of the Third Party Support category; Hi I cannot figure how to pass a variable to LANG_TPL_BROWSE in Layout.tpl -- so here is what I did. ...


Go Back   68 Classifieds Forums > Third Party Support > TemplateCodes

This topic is closed.

This topic is closed to new replies.

 
Thread Tools Display Modes
Old 05-13-2010, 06:37 AM   #1
Ageless Member
 
Bronxgodzilla's Avatar
 
Join Date: Jun 2008
Posts: 133
Rep Power: 14
Bronxgodzilla is on a distinguished road
Default OK to Change Smarty Variables in Layout.tpl?

Hi

I cannot figure how to pass a variable to LANG_TPL_BROWSE in Layout.tpl -- so here is what I did. Please tell me if I am creating a problem elsewhere I am not aware of:

On my home page I added "Browse Categories" (code taken from the accordian file) to my main top horizontal menu. I like how the general Browse function operates. I changed my accordion file's (Left Nav) Main Categories to "List Main Categories.

Since the Left Nav accordian.tpl uses
Code:
<a href="{$smarty.const.URLS}/category.php">{$smarty.const.MOD_LANG_TEMPLATECODES_TEMPLATE_CATEGORIES}
which defaulted to "Main Categories" I created in english.php the statement,
Code:
MOD_LANG_TEMPLATECODES_TEMPLATE_CATEGORIES_LIST
, giving it the variable, "List Main Categories" and added it to accordion.tpl accordingly.

I took from accordion.tpl
Code:
 a class="browse" href="{$smarty.const.URL}/category.php">{$smarty.const.LANG_TPL_BROWSE}</a>
and added it to layout.tpl so it beautifully operates from my top horizontal menu.

So here is the problem -- I wanted to pass the string, "Browse all Categories" to LANG_TPL_BROWSE but I am sure that is a form of concatenation. So I ended up just replacing it (in layout.tpl) with
Code:
MOD_LANG_TEMPLATECODES_TEMPLATE_CATEGORIES
and adding the proper string into english.php

It works! But am I creating a problem I am not aware of? Iis LANG_TPL_BROWSE created just as a kind of shorthand?

Thanks much much for your help in my further understanding of the code.

BarryG
__________________
Currently using Latest version v4.1.10 Developer with latest Templatecodes Sigma (The Greatest)
Bronxgodzilla is offline  
Old 05-13-2010, 07:03 AM   #2
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,175
Rep Power: 78
seymourjames is a jewel in the rough
Default

I am lost on this. What do you actually want to achieve?

1. Do you want a browse tab in your top menu? If so just add this into the menu defined in layout.tpl

<li><a href="{$smarty.const.URL}/category.php">{$smarty.const.LANG_TPL_BROWSE}</a></li>


Now whatever you define LANG_TPL_BROWSE as (which is in langages/english.php) it will appear marked as that in the top menu and incidentally in the accordion. If you want something different in the accordion then you can change the same line in the accordion.tpl file (line 28)

<li><a href="{$smarty.const.URL}/category.php">MY NEW TEXT</a></li>

or visa versa. You can keep it for the accordion and just insert text into the menu item.

2.

Do you want to change the normal title Main Categories in the accordion to List Main Categories

If so you change the string in modules/templatecodes/language/english.php

Here at line 30

define('MOD_LANG_TEMPLATECODES_TEMPLATE_CATEGORIES ', 'Main Categories');
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates and list your 68C site on ClassifiedCodes.com
seymourjames is offline  
Old 05-13-2010, 02:15 PM   #3
Ageless Member
 
Bronxgodzilla's Avatar
 
Join Date: Jun 2008
Posts: 133
Rep Power: 14
Bronxgodzilla is on a distinguished road
Default

Thank you for answering David. Sorry to be sounding confusing. I'd already accomplished everything you point out, and everything is working perfectly - I have different titles for different Browse actions.

My question was I didn't know how or where from the variable "LANG_TPL_BROWSE" came from and didn't want to break anything by my removing it. That you now say that passing any text into <a href="{$smarty.const.URL}/category.php"> answers my question totally, and gives me a whole new sense of freedom & awareness regarding smarty.

Thanks David.


Quote:
Now whatever you define LANG_TPL_BROWSE as (which is in langages/english.php) it will appear marked as that in the top menu and incidentally in the accordion. If you want something different in the accordion then you can change the same line in the accordion.tpl file (line 28)

<li><a href="{$smarty.const.URL}/category.php">MY NEW TEXT</a></li>
__________________
Currently using Latest version v4.1.10 Developer with latest Templatecodes Sigma (The Greatest)
Bronxgodzilla is offline  
Old 05-13-2010, 06:57 PM   #4
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,175
Rep Power: 78
seymourjames is a jewel in the rough
Default

LANG_TPL_BROWSE is defined in root directory /languages/english.php . You can rename it to anything you like. It will not break anything.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates and list your 68C site on ClassifiedCodes.com
seymourjames is offline  
Old 05-15-2010, 09:17 PM   #5
Ageless Member
 
Bronxgodzilla's Avatar
 
Join Date: Jun 2008
Posts: 133
Rep Power: 14
Bronxgodzilla is on a distinguished road
Default

Thanks David and Mike
I have a far greater hands on perception on creating / passing variables and making the templates do what I want. Sigma is the greatest yet. Thanks again for all your help. Can't wait to work on the External Listings and External Search Results modules, not to mention the far far greater possibilities for my new client with the Custom Plugins Modules. Seems Imagination is the limit.

BarryG
__________________
Currently using Latest version v4.1.10 Developer with latest Templatecodes Sigma (The Greatest)
Bronxgodzilla is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using smarty variable with... variables ronin Technical Support 15 02-08-2010 12:54 PM
smarty debug - getting variables seymourjames Modules / Plugins / Modifications 10 07-07-2008 07:06 PM


All times are GMT -4. The time now is 06:56 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0