How do you show a full list of categories?

 
Total Posts: 26

Could not find in eesitekit’s doc a way to show a full list of categories.
So I used the snippet which comes with EE installation.


{exp:weblog:categories weblog=’{embed:weblog}’  style=“nested”}
{category_name}
{/exp:weblog:categories}


The list shows OK (http://dedwyddjones.com/dsh01/index.php/) but the links do not work since the catID is generated not the category_url_title.
Using {category_url_title} instead of {category_name} doesn’t work either.
I don’t want to change the weblog general setting since I would not be able to use the catID in the code.

Is there another way to correct the problem beside hardcoding the category list of links and embedding it into the page?

Many thanks in advance for your advice.

Total Posts: 321

I think what you want is the “Sub-Navigation” tag shown in this list:

http://eesitekit.com/user-guide/kit-embed-tags/

Or did you want to show every single category in the website?

Total Posts: 26

Thanks Kurt.

Yes I’d like a full category list as shown in the left column on http://dedwyddjones.com/dsh01/index.php.
As I wrote, the list shows up OK but the links with the code I have use catID such as C1 instead of cat_url_title.
So they don’t show up on the site (get a 404 on each one).


This full category list brought another problem I got confronted to today. I realize that if I want to use it throughout the site , I can only use one channel (except for the blog which will have its own set of categories).
Indeed, I did build a test channel (about), gave it its own category group so as to make a distinct Landing page and added the home category group so as to have the full list.
But it doesn’t work. Segment 1 of the url picks up the about channel instead of the home channel and the links don’t work.

Means that I’ll have to work with categories instead of channels. At a later date I’ll embed distinctive category pages for the level 1 of the list.
For the time being, I’ll make do with an cat_extended_description.
So on top of each category page, I’d like to show:
    {category_name}
    {cat_extended_description}
then the list of the entries belonging to the category with:
    {Title}
    {Summary}
    Read more link to single entry page.

I tried to include this to the #main-content area of kit_display/category (col 3).
Above your very fist own code.

  {exp:weblog:categories site=’{embed:site}’ weblog=’{embed:weblog}’ dynamic=“off” limit=‘1’ category=’{embed:{segment_2}}’ disable=‘categories|category_fields|member_data|trackbacks’}{if no_results}{redirect=‘404’}{/if}
    {category_name}
    {if category_description} {category_description}  {/if}
    {if cat_extended_description} {cat_extended_description}  {/if}
{/exp:weblog:categories}

then your code untouched from here to the end of the page…
{exp:weblog:entries site=’{embed:site}’ weblog=’{embed:weblog}’ dynamic=“off” limit=‘4’ category=’{embed:{segment_2}}’ disable=‘categories|category_fields|member_data|trackbacks’}{if no_results}{redirect=‘404’}{/if}

Result: a full tree (indented list) of the category list rather than just 1 relevant category.
      No category_description content whatsoever
      No cat_extended_description content either.
(The category I checked did have extended description content)

Where did I go wrong?

Total Posts: 26

Hi Kurt,
Thought I’d have solved the lower part of the above using category_heading instead of category_name. This is the code I emtered but it doesn’t work.


<div id=“main_content”>
 
                          {exp:weblog:category_heading site=’{embed:site}’ weblog=’{embed:weblog}’ dynamic=“off” limit=‘1’ category=’{embed:{segment_2}}’ disable=‘categories|category_fields|member_data|trackbacks’}{if no_results}{redirect=‘404’}{/if}
                          <h1>{category_name}</h1>

                          {if category_description}
                          {category_description}
                          {category_extended_description}
                          {/if}

                            {/exp:weblog:category_heading}

{

                       
                          {exp:weblog:entries site=’{embed:site}’ weblog=’{embed:weblog}’ dynamic=“off” limit=‘10’ category=’{embed:{segment_2}}’ disable=‘categories|category_fields|member_data|trackbacks’}{if no_results}{redirect=‘404’}{/if}

                      <h3>{if embed:host_language == ‘true’}{title}{/if}{if embed:host_language != ‘true’}{main_title_{embed:site_language}}{/if}</h1>

 

                      {!—Edit This Entry Link—}
                      {embed=‘kit_language/{embed:site_language}’ template=‘kit_system/link_edit’ weblog_id=’{weblog_id}’ entry_id=’{entry_id}’}

                      {if main_image}<span class=“float_right”>{main_image}</span>{/if}
                    {main_summary_{embed:site_language}}
                                {embed:lang_read_more} <span>></span>
                          {/exp:weblog:entries}
. .
.</div>


Doesn’t work so I have to revert back so as to be able to hopefully get back to seeing some minimal content.

Now, after more than 24 hours of work put in to solve 3 steps, i.e.
    1)  show the full list of categories-categories children in left column of the site
    2) show a category page with category title, category descriptions and 10 entries in summary version
    3) still have the hard-coded links from menu bar working

I’m back to square one. Zero result.

What do you suggest?

Total Posts: 321

1)  show the full list of categories-categories children in left column of the site

————————————————-

Ah… so basically you want your site map in the left column of the site, instead of a separate page.

You should be able to use the sitemap tags and just stack them up, that way you can control the order of the channels/weblogs:

{embed='kit_language/{embed:site_language}' template='kit_system/engine_sitemap' weblog='about-contact'}
{embed
='kit_language/{embed:site_language}' template='kit_system/engine_sitemap' weblog='campaigns'}
{embed
='kit_language/{embed:site_language}' template='kit_system/engine_sitemap' weblog='services'

Please give that a try and see if it gets you where you want to be with the category list.

Total Posts: 321

2) show a category page with category title, category descriptions and 10 entries in summary version
—————————————————

Since most of our sites don’t use the default category description or image fields, we didn’t code the kit to include them by default. You can add them though.

If this is a bi/multilingual site, then it will get a little more complicated, so lets just do the “Host” language first.

In kit_language/english_uk (I think that’s your host-language right?), you’ll be adding something like this:

category_description='{category_description}' 

That will go right under the passed variables within the {exp:weblog:categories} tag pair near the top of the language template.

It should make the {category_description} available like it would in a stock EE configuration.

Total Posts: 321

3) still have the hard-coded links from menu bar working
———————————————

As long as you hard-code them in eeSiteKit format, they’ll still work fine.

Do you want that navigation row to be without dropdown menus?

There is a way to remove drop-down menus and still use eeSiteKits main nav system.

If you’re interested, let me know and I’ll show you were to look.

Total Posts: 26
Kurt Deutscher - Feb 10, 2010 10:15pm

1) 

————————————————-

Ah… so basically you want your site map in the left column of the site, instead of a separate page.

You should be able to use the sitemap tags and just stack them up, that way you can control the order of the channels/weblogs:

This is great, Kurt. Thanks a million. I can now reconsider using separate channels for some parts of the site.

Total Posts: 26
Kurt Deutscher - Feb 10, 2010 10:29pm

3)
———————————————


Do you want that navigation row to be without dropdown menus?

There is a way to remove drop-down menus and still use eeSiteKits main nav system.

If you’re interested, let me know and I’ll show you were to look.

Thanks, Kurt. Will look into it for the next site. For this one, I need a picture because in text format, I don’t have the space to put all items.
I coded the links with the channels when I had them. And hardcoded the category links.
They work fine now. Problem came from the category page and not the links.

Total Posts: 26
Kurt Deutscher - Feb 10, 2010 10:25pm

2)

In kit_language/english_uk (I think that’s your host-language right?), you’ll be adding something like this:

category_description='{category_description}' 

That will go right under the passed variables within the {exp:weblog:categories} tag pair near the top of the language template.

It should make the {category_description} available like it would in a stock EE configuration.

This is very useful info, Kurt, thank you very much.
Guess one also needs to do so when one uses extensions which provide new variables.

Haven’t tried it yet, ‘cos I haven’t slept for several days and today I have no juice in my brain or in my body.
Will do this tomorrow after a proper sleep.

Total Posts: 26
Kurt Deutscher - Feb 10, 2010 10:25pm

2) show a category page with category title, category descriptions and 10 entries in summary version
—————————————————

Since most of our sites don’t use the default category description or image fields, we didn’t code the kit to include them by default. You can add them though.

If this is a bi/multilingual site, then it will get a little more complicated, so lets just do the “Host” language first.

In kit_language/english_uk (I think that’s your host-language right?), you’ll be adding something like this:

category_description='{category_description}' 

That will go right under the passed variables within the {exp:weblog:categories} tag pair near the top of the language template.

It should make the {category_description} available like it would in a stock EE configuration.

This is what I entered just below the code line below(all lines except the 2 basic ones are commented out since even the basic version doesn’t work)
Position is here:

{exp:weblog:categories site=’{embed:site}’ weblog=’{embed:weblog}’ style=‘linear’ cache=‘yes’ refresh=‘4320’}

Content is here:

{!—This should allow pulling category description and category_extended_description content from its category custom field, see http://eesitekit.com/support/viewthread/159/—}

category_description='{category_description}'   
category_extended_description='{category_extended_description}' 

                                                                        !—EE doesn’t allow two categories custom fields to share the same name, even if in separate channels—}
{!—cat_extended_description=’{category_extended_description}’                                                                          ... so let’s see if we can associate them… probably pushing it over… —}


{!—This is supposed to allow ee tags in html pages
{exp:allow_eecode site }=’{exp:allow_eecode site}’
doesn’t work so far—}

Result: the whole website gets totally garbled so I had to comment out the whole lot .

Total Posts: 26

With a fresher brain, seem to have worked it out. Thank you for your assistance.