Link Manager show category name then links
Link Manager show category name then links
Dear All,
I have added Link Manager to my site and it is exactly what I need. However, I would like to be able to display the title of the category with the links underneath. Is this possible? I added {$link_category} to the sample template but that didn't do anything so I assume I'm barking up the wrong tree.
Can anyone help?
Many thanks in anticipation,
James.
I have added Link Manager to my site and it is exactly what I need. However, I would like to be able to display the title of the category with the links underneath. Is this possible? I added {$link_category} to the sample template but that didn't do anything so I assume I'm barking up the wrong tree.
Can anyone help?
Many thanks in anticipation,
James.
Re: Link Manager show category name then links
Use:
{$item.link_category}
Nullig
{$item.link_category}
Nullig
Re: Link Manager show category name then links
This did not work for me. All I got was a messed up page.
I've used {LinkMgr category=""} and got my test link without the associated category.
I've used {LinkMgr category=""} and got my test link without the associated category.
Re: Link Manager show category name then links
use {get_template_vars} and the print_r modifier to learn which variables you can use... check http://docs.cmsmadesimple.org/troubleshooting/tips
Re: Link Manager show category name then links
Thanks, Jos. That was interesting. Here's most of what I got:
app_name = CMS
cgsimple = Object
feu_smarty = Object
ccuser = Object
tbtools = Object
tbmobile = Object
content_obj = Object
content_id = 82
page = links
page_id = links
page_name = links
page_alias = links
position = 4
friendly_position = 4
lang = en_US
encoding = utf-8
smarty =
actionid = m6713d
actionparams = Array (3)
returnid = 82
actionmodule = LinkMgr
menuparams = Array (3)
count = 7
nodelist = Array (3)
number_of_levels = 10000
node = Array (12)
classes = menuactive
search_actionid = cntnt01
hogan = onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;"
searchtext = Enter Search...
startform = <form id="cntnt01moduleform_1" method="get"
<div class="hidden">
<input type="hidden" name="mact" value="Search,cntnt01,dosearch,0" />
<input type="hidden" name="cntnt01returnid" value="82" />
</div>
label = <label for="cntnt01searchinput">Search</label>
searchprompt = Search
submittext = Submit
endform = </form>
starttext = You are here
spanclass = crumb
extraspanclass = current
prevpage = <
firstpage = <<
pagenumber = 1
pagecount = 3
oftext = of
pagetext = Page
itemcount = 3
items = Array (3)
category_label = Category:
author_label = Posted by:
param_number = 3
param_detailpage = 73
param_module = News
param_pagenumber = 3
category_name =
cats = Array (5)
entry = Object
target =
href =
What exactly should I see there?
Thanks again.
app_name = CMS
cgsimple = Object
feu_smarty = Object
ccuser = Object
tbtools = Object
tbmobile = Object
content_obj = Object
content_id = 82
page = links
page_id = links
page_name = links
page_alias = links
position = 4
friendly_position = 4
lang = en_US
encoding = utf-8
smarty =
actionid = m6713d
actionparams = Array (3)
returnid = 82
actionmodule = LinkMgr
menuparams = Array (3)
count = 7
nodelist = Array (3)
number_of_levels = 10000
node = Array (12)
classes = menuactive
search_actionid = cntnt01
hogan = onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;"
searchtext = Enter Search...
startform = <form id="cntnt01moduleform_1" method="get"
<div class="hidden">
<input type="hidden" name="mact" value="Search,cntnt01,dosearch,0" />
<input type="hidden" name="cntnt01returnid" value="82" />
</div>
label = <label for="cntnt01searchinput">Search</label>
searchprompt = Search
submittext = Submit
endform = </form>
starttext = You are here
spanclass = crumb
extraspanclass = current
prevpage = <
firstpage = <<
pagenumber = 1
pagecount = 3
oftext = of
pagetext = Page
itemcount = 3
items = Array (3)
category_label = Category:
author_label = Posted by:
param_number = 3
param_detailpage = 73
param_module = News
param_pagenumber = 3
category_name =
cats = Array (5)
entry = Object
target =
href =
What exactly should I see there?
Thanks again.
Re: Link Manager show category name then links
that is the result of get_template_vars.
You can see that there is an array called $items, but my wild guess is that that is from the news module.
it makes a lot of difference where you put the get_template_vars tag.Use it at the end of your LinkMngr template, or right after the {LinkMngr} tag.
The content of the arrays can be checked with e.g. <pre>{$items|print_r}</pre>
You can see that there is an array called $items, but my wild guess is that that is from the news module.
it makes a lot of difference where you put the get_template_vars tag.Use it at the end of your LinkMngr template, or right after the {LinkMngr} tag.
The content of the arrays can be checked with e.g. <pre>{$items|print_r}</pre>
Re: Link Manager show category name then links
Thanks.
Yes, I put it right at the end of the template code as the last line. And as I looked at it, I too thought that the other modules had some added information. Therefore I was unable to find anything pertinent to Link Manager itself.
Yes, I put it right at the end of the template code as the last line. And as I looked at it, I too thought that the other modules had some added information. Therefore I was unable to find anything pertinent to Link Manager itself.
Re: Link Manager show category name then links
Read help text
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Link Manager show category name then links
Thanks, Rolf. But I've read it many times.
I have three categories with a link in each one.
I chose to use
{LinkMgr category=""}
to get all the categories listed.
I put that right on the page as html.
Saved page, and when I displayed it, I got only the three links, but no categories.
Maybe you were thinking of something else that I might have missed?
I have three categories with a link in each one.
I chose to use
{LinkMgr category=""}
to get all the categories listed.
I put that right on the page as html.
Saved page, and when I displayed it, I got only the three links, but no categories.
Maybe you were thinking of something else that I might have missed?
Re: Link Manager show category name then links
Help contains this sample code that displays category name above links:
Code: Select all
<div class="linkmgr">
{foreach from=$items item='item'}
{if $item.link_category != $foo|default:''}<h3>{$item.link_category}</h3>{/if}
<div class="row">
<div class="column">
<img src="{$item.link_img|default:'uploads/images/linkmgr/noimage.jpg'}" width="100" height="100" alt="{$item.link_name}" />
</div>
<div class="column">
<a href="{$item.link_url}" target="_blank">{$item.link_name}</a>
</div>
<div class="column">
{$item.link_desc|default:''}
</div>
</div>
<div style="clear: both"></div>
{$foo = $item.link_category}
{/foreach}
</div>
Re: Link Manager show category name then links
Now I'm confused. Are you pointing out that I should not use the provided code of {LinkMgr category=""}, but instead use that whole section of code you listed? If that is so, what is the point of the smarty shortcut?
Re: Link Manager show category name then links
What would be the use of using the 'category' parameter (showing only the links of one specific category) if you want to show all categories?
So, do NOT use the 'category' parameter and try using the template I posted earlier.
So, do NOT use the 'category' parameter and try using the template I posted earlier.
Re: Link Manager show category name then links
Because,
(optional) category="" - Specifies the category of links to display. If not specified, all categories are displayed.
Re: Link Manager show category name then links
What LinkMgr release do you use?
Is it an upgraded module, or new install?
Is it an upgraded module, or new install?
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Link Manager show category name then links
Of course you use the Smarty shortcut. The code I posted is to be used in LinkMgr template.KitchM wrote:Now I'm confused. Are you pointing out that I should not use the provided code of {LinkMgr category=""}, but instead use that whole section of code you listed? If that is so, what is the point of the smarty shortcut?
If you want all categories listed then:I chose to use
{LinkMgr category=""}
to get all the categories listed.
- do NOT use the 'categories' parameter
- change the used LinkMgr template to contain the sample code I posted (and comes from module's help).
It just works for me this way.