WeblogCategories II

View: New views
5 Messages — Rating Filter:   Alert me  

WeblogCategories II

by Horatia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello!

Is there a way to hide one category of
categories  displayed; e.g. from:

All                   All
Music                 General
General      to       Java
Java                  

Thank you.

Horatia

Re: WeblogCategories II

by Dave-401 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Sep 23, 2009 at 10:58 PM, Horatia <roller-ml@...> wrote:
> Is there a way to hide one category of
> categories  displayed; e.g. from:
>
> All                   All
> Music                 General
> General      to       Java
> Java

Write your own template and show only the categories you want to display.

You don't have to use the built in #showWeblogCategoryLinksList() macro.

- Dave

Re: WeblogCategories II

by Ana Pardo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello! I have a problem with customizing the way categories are displayed. I want to list each category individually, so the only way i could think to do this is:

<p>#set($rootCategory = $model.weblog.getWeblogCategory("Noticias"))
 #showWeblogCategoryLinksList($model.weblog.getWeblogCategory("Noticias") false true)</p>
<p> #set($rootCategory = $model.weblog.getWeblogCategory("Nuestras Marcas"))
#showWeblogCategoryLinksList($rootCategory false true)</p>
<p>#set($rootCategory = $model.weblog.getWeblogCategory("Eventos"))
#showWeblogCategoryLinksList($rootCategory false true)</p>

This code gives me two problems:

1) When i select any of those categories the name changes to "categoryObject.name". I don't understand wy it doesn't shows the name of the category instead. Is there an easier way to list the category one by one? Or is there something else i have to add to my code?

2) It appends a bullet at the beginning of the category name. I can't find the way of deleting that, i have removed the tags <li></li>,<ul></ul>, and any other tag asociated with list in html and it doesn't go away. Is there a way of doing this?

Horatia wrote:
Hello!

Is there a way to hide one category of
categories  displayed; e.g. from:

All                   All
Music                 General
General      to       Java
Java                  

Thank you.

Horatia

Re: WeblogCategories II

by Dave-401 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Nov 19, 2009 at 11:36 AM, Ana Pardo <anampardo@...> wrote:

> Hello! I have a problem with customizing the way categories are displayed. I
> want to list each category individually, so the only way i could think to do
> this is:
>
> <p>#set($rootCategory = $model.weblog.getWeblogCategory("Noticias"))
>  #showWeblogCategoryLinksList($model.weblog.getWeblogCategory("Noticias")
> false true)</p>
> <p> #set($rootCategory = $model.weblog.getWeblogCategory("Nuestras Marcas"))
> #showWeblogCategoryLinksList($rootCategory false true)</p>
> <p>#set($rootCategory = $model.weblog.getWeblogCategory("Eventos"))
> #showWeblogCategoryLinksList($rootCategory false true)</p>
>
> This code gives me two problems:
>
> 1) When i select any of those categories the name changes to
> "categoryObject.name". I don't understand wy it doesn't shows the name of
> the category instead. Is there an easier way to list the category one by
> one? Or is there something else i have to add to my code?

That is probably because $model.weblog.getWeblogCategory("Noticias")
or some other call to getWeblogCategory() is failing and returning
null. You might need to pass "/Noticias"


> 2) It appends a bullet at the beginning of the category name. I can't find
> the way of deleting that, i have removed the tags <li></li>,<ul></ul>, and
> any other tag asociated with list in html and it doesn't go away. Is there a
> way of doing this?

If you use #showWeblogCategoryLinksList() then you're gonna get a list
(i.e. with <li> elements). You can use CSS styles to make those go
away.

You don't have to use #showWeblogCategoryLinksList(), you can write
your own Velocity code to display the categories any way you'd like.

Hope that helps...

- Dave

Re: WeblogCategories II

by Ana Pardo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank You so much for your answer. I tried to put
$model.weblog.getWeblogCategory("/Noticias") and i still get the same
problem.
Also i tried with:

- #showWeblogCategoryLinksList("/Noticias" false true)
- $model.weblogCategory("/Noticias")
- This code from de roller template guide

#foreach ($cat in $model.weblog.categories)

#if ($cat.name != "Music")

$cat.name<br>

#end

#end

I tried several ways using the roller- template guide. And i can't find
something that helps. Is there a macro that just display a string that i
tell it to. Something that works like an echo on other languajes? I just
want to get the name of the category and display it.




2009/11/23 Dave <snoopdave@...>

> On Thu, Nov 19, 2009 at 11:36 AM, Ana Pardo <anampardo@...> wrote:
> > Hello! I have a problem with customizing the way categories are
> displayed. I
> > want to list each category individually, so the only way i could think to
> do
> > this is:
> >
> > <p>#set($rootCategory = $model.weblog.getWeblogCategory("Noticias"))
> >  #showWeblogCategoryLinksList($model.weblog.getWeblogCategory("Noticias")
> > false true)</p>
> > <p> #set($rootCategory = $model.weblog.getWeblogCategory("Nuestras
> Marcas"))
> > #showWeblogCategoryLinksList($rootCategory false true)</p>
> > <p>#set($rootCategory = $model.weblog.getWeblogCategory("Eventos"))
> > #showWeblogCategoryLinksList($rootCategory false true)</p>
> >
> > This code gives me two problems:
> >
> > 1) When i select any of those categories the name changes to
> > "categoryObject.name". I don't understand wy it doesn't shows the name of
> > the category instead. Is there an easier way to list the category one by
> > one? Or is there something else i have to add to my code?
>
> That is probably because $model.weblog.getWeblogCategory("Noticias")
> or some other call to getWeblogCategory() is failing and returning
> null. You might need to pass "/Noticias"
>
>
> > 2) It appends a bullet at the beginning of the category name. I can't
> find
> > the way of deleting that, i have removed the tags <li></li>,<ul></ul>,
> and
> > any other tag asociated with list in html and it doesn't go away. Is
> there a
> > way of doing this?
>
> If you use #showWeblogCategoryLinksList() then you're gonna get a list
> (i.e. with <li> elements). You can use CSS styles to make those go
> away.
>
> You don't have to use #showWeblogCategoryLinksList(), you can write
> your own Velocity code to display the categories any way you'd like.
>
> Hope that helps...
>
> - Dave
>