Can we have a varible to access the Category URL Indicator. I want the client to be able to change this without having to edit templates. So this…
{parent_category_start}
<h1><a href="http://{homepage}/category/{parent_category_url_title}/">{parent_category_name}</a></h1>
could be this…
{parent_category_start}
<h1><a href="http://{homepage}/{category_url_indicator}/{parent_category_url_title}/">{parent_category_name}</a></h1>
I have a a rather puzzling problem … i have a parent category with just 2 child categories. however, when i use the code below, the 2 child categories are shown 5 times each. As you can see, I have pared down the code down to the bone-not sure why the child category names are repeating. Any ideas>
<h3>Categories</h3>
{exp:weblog:categories weblog="clients" limit="1" status="not draft"}
{exp:child_categories parent="95" show_empty="no" site="1" }
{child_category_start}
<a href="http://{homepage}/category/{child_category_url_title}/">{child_category_name}</a>
{entries_total}
{child_category_end}
{/exp:child_categories}
{/exp:weblog:categories}
Update: looks like it has something to do with wrapping the child category code with the exp:weblog tags. if i remove it. it works fine.
I’m having trouble with a nested category_id & child_categories setup. I want the page to just display all the categories in categories_group 1 if no parent is specified, but otherwise use the supplied category as the parent. I’ve tried lots of things, and have found that having both the parent and category_group parameters specified results in the category_group being ignored, so I’ve tried to work around it with a conditional:
{exp:category_id category_group="1" category_url_title="{segment_3}" parse="inward" on_failure="none"}
{exp:child_categories
{if category_id != "none"}
parent="{category_id}"
{if:else}
category_group="1"
{/if}
parse="inward"}
... output stuff ...
{/exp:child_categories}
{/exp:category_id}
but that still doesn’t work. When no category is specified I get all categories from all groups.
Any advice?
thanks
-e
I have a trailing comma on a list of categories and I can’t figure out how to get rid of it. I didn’t see a backspace parameter in the documentation, and applying it to the enclosing weblog entries tag doesn’t work. Here’s just the code for the child categories tags I’m using:
{exp:child_categories parent="17|18|21"}
{entries_start}
<a href="/books/category/{parent_category_url_title}/">{parent_category_name}</a>: <a href="/books/category/{child_category_url_title}/">{child_category_name}</a>,
{entries_end}
{/exp:child_categories}
If I’ve missed something and there’s another way to search for support on this issue, please let me know. It would be awesome to have a “search this thread” button at the top of these long add-on support threads. After awhile, they just get too big to be useful. Should I submit a feature request to EllisLabs?
Thank you. I’ve installed the Replace Plus plugin, but all my tests have failed. I’m not quite clear on where I should put the tags. Here’s what I’ve got (Dog is a category name; I’m just doing this to test):
{exp:replace_plus find="Dog" replace="find"}
{entries_start}
<a href="/books/category/{parent_category_url_title}/">{parent_category_name}</a>: <a href="/books/category/{child_category_url_title}/">{child_category_name}</a>,
{entries_end}
{/exp:replace_plus}
{/exp:child_categories}
I suppose to remove the trailing comma I would use something like this?
{exp:replace_plus find="$," regex="yes"}
Hi,
You should wrap exp:child_categories tag with exp:replace_plus tag:
{exp:replace_plus find="Dog" replace="find" parse="inward"}
{exp:child_categories}
{entries_start}
<a href="/books/category/{parent_category_url_title}/">{parent_category_name}</a>: <a href="/books/category/{child_category_url_title}/">{child_category_name}</a>,
{entries_end}
{/exp:child_categories}
{/exp:replace_plus}
When I make the changes you suggest, the tags don’t parse and I get this:
Category: {entries_start} {parent_category_name}: {child_category_name}, {entries_end} {/exp:child_categories}
I’ve copied more of the template code I’m using below, with your suggestions. I didn’t see mention whether PHP needs to be turned off or on in the template for this plugin to work. Perhaps the location of the weblog entries tag affects it? I don’t really know what else to try.
<div class="entriesbot">
{exp:weblog:entries weblog="books"}
<div class="book">{exp:imgsizer:size src="{cover-img}" width="50" alt="{title}" class="book-img"}</div>
<h2>{title}</h2>
<div class="book-details">
<strong>Author</strong>: {author-first} {author-last}
<strong>Publication Date</strong>: {book-date format="%F %d, %Y"}
<strong>Length</strong>: {book-length} pages
<strong>Category</strong>:
{exp:replace_plus find="Dog" replace="find" parse="inward"}
{exp:child_categories}
{entries_start}
<a href="/books/category/{parent_category_url_title}/">{parent_category_name}</a>: <a href="/books/category/{child_category_url_title}/">{child_category_name}</a>,
{entries_end}
{/exp:child_categories}
{/exp:replace_plus}
<strong>From the Publisher</strong>: {book-desc}
</div><!--end book-details div-->
{/exp:weblog:entries}
</div><!--end entriesbot div-->
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.