Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Display category listing using "default" index.php page
SVN is stil 4.0.1 until such time as the public release happens. You could consider it as 4.0.1+
Yazmin, could you show how you were trying to use <code><txp:else /></code> cuz I use it with glx_if without problem.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Display category listing using "default" index.php page
> thebombsite wrote:
> Yazmin, could you show how you were trying to use <code><txp:else /></code> cuz I use it with glx_if without problem.
Sure. This is what I have now, modified to use the txp:else tag, that doesn’t work:
<pre>
<txp:glx_if_category_list>
<txp:if_category name=“bracelets”>
<h3>Bracelets</h3>
<div id=“product_list”><txp:article_custom listform=“excerpt_products” limit=“100” category=“Bracelets” /></div>
</txp:if_category>
<txp:if_category name=“necklaces”> <h3>Necklaces</h3> <div id=“product_list”><txp:article_custom listform=“excerpt_products” limit=“100” category=“Necklaces” /></div> </txp:if_category>
<txp:if_category name=“earrings”>
<h3>Earrings</h3>
<div id=“product_list”><txp:article_custom listform=“excerpt_products” limit=“100” category=“Earrings” /></div>
</txp:if_category>
<br clear=“all” />
<txp:else />
<h3>Latest Pieces</h3>
<div id=“product_list”><txp:article_custom listform=“excerpt_products” limit=“9” section=“shop” /></div>
<br clear=“all” />
<txp:article form=“default” limit=“1” />
<p><a href=”/news”>Other news >></a></p>
</txp:glx_if_category_list>
</pre>
</pre>
On an unrelated note, when I upgraded, I found that txp:c no longer displayed my category names with the first letter uppercase. I noticed that there is a “Category Title” field now, but was not able to find the tag to use the category title. Suggestion?
Offline
Re: Display category listing using "default" index.php page
You can use <txp:category title="1" />
to display a category’s title.
Offline
Re: Display category listing using "default" index.php page
This <code><br clear=“all” /></code> is new to me. I take it that is supposed to clear floats?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Display category listing using "default" index.php page
Well you learn something new every day don’t you. Anyway I checked that tag out and it seems you don’t need the “” quotes around all.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Display category listing using "default" index.php page
It does, although it’s deprecated. See the HTML documentation at w3.org. I’d rather go for <br style="clear:both;">
or for overflow: auto;
.
Offline
Re: Display category listing using "default" index.php page
Yep I usually use style= or if it’s a recurring thing then do it in the CSS. Maybe set up a class for “hr”. I just haven’t seen “br” used like that before. :( And in the examples at w3.org they use the “” quotes. Mmmm.
Yazmin, what version of glx_if do you have?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Display category listing using "default" index.php page
> wet wrote:
> You can use <txp:category title="1" />
to display a category’s title.
Thanks wet. I tried the tag that way and it doesn’t display the title at all. I ended up having to use txp:c title=“1”, but now the category name is lowercase instead of having the first letter capitalized.
> thebombsite wrote:
> This <code><br clear=“all” /></code> is new to me. I take it that is supposed to clear floats?
Yes, br clear=all is used to clear floats and is a deprecated element. (Just haven’t cleaned everything up yet.)
> thebombsite wrote:
> Yazmin, what version of glx_if do you have?
I am using version 0.6.4.
Last edited by ywickham (2005-10-16 00:53:07)
Offline
Re: Display category listing using "default" index.php page
I don’t think the “title” attribute was available for 4.0.1 if that’s what you use.
I can’t see why it won’t work for you but thankfully you have a different solution. :)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#22 2005-10-16 01:28:50
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Display category listing using "default" index.php page
> “I tried the tag that way and it doesn’t display the title at all… the category name is lowercase…”
That wouldn’t work because not all tags have the same parameters or abilities. <txp:c />
is not a true tag – which is why it is not in the manual – it merely returns the value of whatever is in the url variable. As an example, say someone tries to load up ?c=apples
, but you don’t actually have a category with that name. <txp:c />
will still return “apples”.
> “I don’t think the ‘title’ attribute was available for 4.0.1 if that’s what you use.”
The title attribute was indeed available for 4.0.1, but there is no tag <txp:category />
. There is <txp:category1 />
and <txp:category2 />
. There’s also my plugin that fills in some of the gaps.
Offline
Re: Display category listing using "default" index.php page
> mary wrote:
> > “I tried the tag that way and it doesn’t display the title at all… the category name is lowercase…”
That wouldn’t work because not all tags have the same parameters or abilities. <txp:c />
is not a true tag – which is why it is not in the manual – it merely returns the value of whatever is in the url variable. As an example, say someone tries to load up ?c=apples
, but you don’t actually have a category with that name. <txp:c />
will still return “apples”.
> “I don’t think the ‘title’ attribute was available for 4.0.1 if that’s what you use.”
The title attribute was indeed available for 4.0.1, but there is no tag <txp:category />
. There is <txp:category1 />
and <txp:category2 />
. There’s also my plugin that fills in some of the gaps.
Thanks for clarifying all that Mary. I appreciate it. I’ve just ended up installing your plug-in so that I can get the category to display the way I want it to.
As for the txp:else with the glx_if, I’ll just leave it as is. :)
Offline
Re: Display category listing using "default" index.php page
> mary wrote:
<blockquote>
The title attribute was indeed available for 4.0.1, but there is no tag <txp:category />
.
</blockquote>
I beg to differ. At least in my (unmodified) version of taghandlers.php there is this function starting on line #1019:
<pre>
function category($atts)
{
global $pretext;
extract(lAtts(array(
‘link’ => 0,
‘title’ => 0,
‘name’ => ‘’,
‘wraptag’ => ‘’,
‘section’ => @$pretext[‘s’],
),$atts));
if ($name) $cat = $name;
else $cat = @$pretext[‘c’];
[…]
</pre>
This function receives parameters which are common among tag handling functions, so I suppose its ok to use this as a tag. And it displays the current or a named category’s name or title. BTDT.
//w&
Last edited by wet (2005-10-16 06:45:17)
Offline