- Moderated by:
- Support Team
-
- rank:
-
Helper
- registered:
- March 2005
- Status:
- offline
- last visit:
- 17.11.08
- Posts:
- 358
I am converting the travelogue theme for PN.8 and am having problems finding the way to display the correct category that a news article uses.. In .764 it worked with this code in /travelogue/template/News-article.htm:
Code
<div class="post_head">
<h2 id="post-<!--[$info.sid]-->"><!--[$info.title]--></h2>
<p class="postmetadata"><!--[pnml name=_PARTOF]--> <a href="user.php?op=userinfo&uname=<!--[$info.informant]-->"><!--[$info.informant]-->'s</a> <!--[pnml name=_ADVENTUREIN]--> <a href="index.php?name=News&topicid=<!--[$info.topicid]-->"><!--[$info.topictext]--></a> <!--[articleadminlinks sid=$info.sid]--></p>
</div>
to display this:
Part of admin's adventure in Name_Of_Topic [ Edit | Delete ]
Now, I just need to know the correct usage for displaying the category instaed of topic. I know this is wrong but here is what I have in travelogue/templates/modules/News/news_user_index.htm:
Code
<div class="post_head">
<h2 id="post-<!--[$info.sid]-->"><a href="<!--[$links.fullarticle]-->" rel="bookmark" title="<!--[pnml name=_PERMALINK]--> <!--[$info.title]-->"><!--[$info.title]--></a></h2>
<p class="postmetadata"><!--[pnml name=_PARTOF]--> <a href="user.php?op=userinfo&uname=<!--[$info.informant]-->"><!--[$info.informant]-->'s</a> <!--[pnml name=_ADVENTUREIN]--> <a href="index.php?module=News&func=display&sid=<!--[$info.sid]-->"><!--[$info.cattext]--></a> <!--[articleadminlinks sid=$info.sid]--></p>
</div>
Any help? Where do I look? I've been through all of the news templates and can't find my bearings...
--
[ stevencopley.com ] -
- rank:
-
Helper
- registered:
- March 2005
- Status:
- offline
- last visit:
- 17.11.08
- Posts:
- 358
While I'm at it, how would I change the display from choosing a topic to choosing a category?
http://gmc.websitewelcome.com/~prodigal/ - Just in the center and under the image header, next to search field...
I have News Module assigned to the news specific categories in the categories registry...
Any help would be appreciated. :)
--
[ stevencopley.com ] -
- rank:
-
Professional
- registered:
- September 2006
- Status:
- offline
- last visit:
- 21.11.08
- Posts:
- 1450
Ok, here's the "pain" with the current News code...
The News module has a lot of code just for backward compatibility and the Topics are a deprecated module, just there for backward compatibility too...
Additionally, currently the current module supports the Multi-Categorization of items but still needs to update its functions as filter the list depending on the Category/property (currently only is able to filter the 'Main' category), so, you can only show to which category belongs the article, but not list all the article in those additional categories.
By now, i'm showing that second category with this code:
where PropName is the property name of your second/third/* category...Code
<!--[if $info.__CATEGORIES__.PropName]-->
<!--[$info.__CATEGORIES__.PropName.name]-->
<!--[/if]-->
I'm the ValueAddons coordinator now, and i'm in charge of the News module.
I'll extend its functionality to manage completely the Multi-Categorization on all it's functions as soon as possible.
The NOC space is: http://noc.postnuke.com/projects/vanews
keep posted to its SVN copy!
--
- Mateo T. -
Mis principios... son mis fines -
- rank:
-
Helper
- registered:
- March 2005
- Status:
- offline
- last visit:
- 17.11.08
- Posts:
- 358
How about the code to just show the current, top level category?
e.g.
Part of admin's adventure in Website Updates [ Edit | Delete ]
If 'Website Updates' is a top level category in the root/Modules/News/ category tree.
Is it just this:
Code
<!--[$info.__CATEGORIES__.name]-->
edited by: jaenosjelantru, Feb 26, 2008 - 01:53 PM
--
[ stevencopley.com ] -
- rank:
-
Professional
- registered:
- September 2006
- Status:
- offline
- last visit:
- 21.11.08
- Posts:
- 1450
Nope,
the __CATEGORIES__ array is indexed with the Property names Registered in the module. If you have a fresh install of the News module, you'll have only the 'Main' property registered, and you have to access to its info with $info.__CATEGORIES__.Main.name
Insert the plugin <--[pndebug]--> in your news_user_display.htm template to see all the information loaded in pnRender that you can use.
--
- Mateo T. -
Mis principios... son mis fines -
- rank:
-
Helper
- registered:
- March 2005
- Status:
- offline
- last visit:
- 17.11.08
- Posts:
- 358
Put in here:
travelogue/templates/modules/News/news_user_index.htm
?
This is not displaying anything that I can see.
--
[ stevencopley.com ] -
- rank:
-
Helper
- registered:
- March 2005
- Status:
- offline
- last visit:
- 17.11.08
- Posts:
- 358
Hi, I'm retraded. Pop-ups ftw!
You just opened me up to a whole new world of information I don't have time for. This is so helpful and cool. I feel like a bigger n00b every time I come here.
Thanks for the help.
--
[ stevencopley.com ] -
- rank:
-
Helper
- registered:
- March 2005
- Status:
- offline
- last visit:
- 17.11.08
- Posts:
- 358
Did I mention how cool you are for showing me the debug thing...
I got it working:
Code
<a href="index.php?module=News&func=view&cat=<!--[$info.cat]-->"><!--[$info.cattitle]--></a>
edited by: jaenosjelantru, Feb 26, 2008 - 02:41 PM
--
[ stevencopley.com ] -
- rank:
-
Helper
- registered:
- March 2005
- Status:
- offline
- last visit:
- 17.11.08
- Posts:
- 358
Ok, so I am trying to use the travelogue theme still on this particular site and need to fix the category selection at the top:
http://prodigaloutreach.org/index.php?module=News
I have included pndebug on this template. Right now, the master template references this:
Code
<div id="subheader">
<div id="search">
<h3><!--[pnml name=_SEARCH]--> <!--[sitename]-->:</h3>
<!--[pnml name=_SEARCH assign=searchlabel]-->
<!--[search class=searchform button=$searchlabel]--></div>
<div id="cats">
<h3><!--[pnml name=_CHOOSECAT]-->:</h3>
<form action="index.php?name=News" method="post">
<div>
<!--[topicsdropdown]-->
<input type="submit" value="<!--[pnml name=_SUBMIT]-->" />
</div>
</form>
</div>
</div>
the topicsdropdown is what I need to use to grab a list of the categories instead of the topics assigned to the News module.
Any idears?
--
[ stevencopley.com ]
