Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-10-06 19:43:21

tydaikho
Member
From: VietNam
Registered: 2010-09-20
Posts: 16
Website

How can i add a class to list break tag?

I build a Category_list tag:

<txp:category_list active_class=“current” break=“li” class=“test” label=“Categories” labeltag=“h3” type=“article” wraptag=“ul” />

I get a category list output with <li> tag.
the output like:
<ul class=“test”>
<li>abc</li>
<li>abc</li>
<li>abc</li>
….

The “CSS class” property is only for <ul> tag. I want to asign <li> with a css class like <li class=“abc”> but i don’t see that property in tag builder tool. How can i do that? Pls help me… Thank you.

Last edited by tydaikho (2010-10-06 20:03:37)


http://vnsx.net | http://tydaikho.tk | http://txpblog.tk

Offline

#2 2010-10-06 19:55:04

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How can i add a class to list break tag?

See category_list on TextBook and take a look at the example number 3. According the guidelines it gives us:

<txp:category_list wraptag="ul" break="" class="test" label="Categories" labeltag="h3">
	<li class="<txp:if_category name='<txp:category />'>current<txp:else />abc</txp:if_category>">
		<txp:category title="1" link="1" />
	</li>
</txp:category_list>

Last edited by Gocom (2010-10-06 20:00:51)

Offline

#3 2010-10-06 20:13:58

tydaikho
Member
From: VietNam
Registered: 2010-09-20
Posts: 16
Website

Re: How can i add a class to list break tag?

Thank you for you quick rely… i try your example and the problem is fixed… ;) . I am not English country so i get troubles when i look for fixing my problem in manual docs. thanks again…
By the way, i want to ask some thing more?
Textpattern shows full article on frontpage (default). I want to show in my way, every article on frontpage will display introtext – not fulltext and my visitor click on Keep reading button to get full article. May i?


http://vnsx.net | http://tydaikho.tk | http://txpblog.tk

Offline

#4 2010-10-06 20:35:34

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How can i add a class to list break tag?

In short: in your article form, replace <txp:body /> with something like this:

<txp:if_individual_article>
   <txp:body />
<txp:else />
   <txp:excerpt />
   <p><txp:permlink>Keep reading</txp:permlink></p>
</txp:if_individual_article>

Or this does the same:

<txp:if_article_list>
   <txp:excerpt />
   <p><txp:permlink>Keep reading</txp:permlink></p>
<txp:else />
   <txp:body />
</txp:if_article_list>

Here is a more extended FAQ about this: How do I show only an excerpt in article lists?

Offline

#5 2010-10-06 20:40:12

tydaikho
Member
From: VietNam
Registered: 2010-09-20
Posts: 16
Website

Re: How can i add a class to list break tag?

I see a pagination plugin on Textpattern resource but the download link is not actived more (http://textpattern.org/plugins/166/hfw_pg). I want show long article via multi page. May i? Thank you for your rely …

(pagination for article, not article list)

Last edited by tydaikho (2010-10-06 20:50:36)


http://vnsx.net | http://tydaikho.tk | http://txpblog.tk

Offline

#6 2010-10-06 21:02:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How can i add a class to list break tag?

Maybe this one? http://textpattern.org/plugins/165/etz_pg.

It’s better to start a new topic if you have a new question ;)

Offline

#7 2010-10-06 21:09:33

tydaikho
Member
From: VietNam
Registered: 2010-09-20
Posts: 16
Website

Re: How can i add a class to list break tag?

Ok … i am afraid of being spammer ;) . Because i get many questions … Thank you… Good work. ;)

Last edited by tydaikho (2010-10-06 21:09:53)


http://vnsx.net | http://tydaikho.tk | http://txpblog.tk

Offline

#8 2010-10-06 22:00:29

tydaikho
Member
From: VietNam
Registered: 2010-09-20
Posts: 16
Website

Re: How can i add a class to list break tag?

Not fix. Here is my Homepage:

<div id=“left”>
<div class=“post”>

<txp:if_category> <h2><txp:category title=“1” /></h2>

<div class=“hfeed”> <txp:article form=“article_listing” limit=“5” /> </div>
<txp:else /> <txp:if_search> <h2><txp:text item=“search_results” />: <txp:page_url type=“q” /></h2>

<div class=“divider”><txp:image id=“1” /></div> </txp:if_search>

<div class=“hfeed”> <txp:article limit=“5” /> </div>
</txp:if_category>

<txp:if_individual_article> <div class=“divider”><txp:image id=“1” /></div>

<p><txp:link_to_prev>« <txp:prev_title /></txp:link_to_prev> <txp:link_to_next><txp:next_title /> »</txp:link_to_next></p>
<txp:else /> <p><txp:older>« <txp:text item=“older” /></txp:older> <txp:newer><txp:text item=“newer” /> »</txp:newer></p>
</txp:if_individual_article>

</div>
</div>

And my default form:

<txp:if_individual_article>
<h1 class=“entry-title”><txp:permlink><txp:title /></txp:permlink></h1>
<txp:else />
<h3 class=“entry-title”><txp:permlink><txp:title /></txp:permlink></h3>
</txp:if_individual_article>

<p class=“published”><txp:posted /></p>

<div class=“entry-content”>
<txp:body />
</div>

<address class=“vcard author”>— <span class=“fn”><txp:author /></span></address>

<p class=“tags”><txp:category1 title=“1” link=“1” />, <txp:category2 title=“1” link=“1” /></p>

<txp:comments_invite wraptag=“p” />

<div class=“divider”><txp:image id=“1” /></div>

I replace <txp:body /> with one of your way … my frontpage lists only title without any introtext… Pls help me …

Els wrote:

In short: in your article form, replace <txp:body /> with something like this:

<txp:if_individual_article>
   <txp:body />
<txp:else />
   <txp:excerpt />
   <p><txp:permlink>Keep reading</txp:permlink></p>
</txp:if_individual_article>

Or this does the same:

<txp:if_article_list>
   <txp:excerpt />
   <p><txp:permlink>Keep reading</txp:permlink></p>
<txp:else />
   <txp:body />
</txp:if_article_list>

Here is a more extended FAQ about this: How do I show only an excerpt in article lists?

Last edited by tydaikho (2010-10-06 22:01:11)


http://vnsx.net | http://tydaikho.tk | http://txpblog.tk

Offline

#9 2010-10-06 22:18:13

tydaikho
Member
From: VietNam
Registered: 2010-09-20
Posts: 16
Website

Re: How can i add a class to list break tag?

Sory for my TXP knowledge. Frontpage article will be fixed with excerpt. Writing introtext to excerpt form and bodytext to body form or using article_excerpts_homepage, i get things i need… Thanks TXP… ;)

Last edited by tydaikho (2010-10-06 22:46:31)


http://vnsx.net | http://tydaikho.tk | http://txpblog.tk

Offline

#10 2010-10-10 18:44:55

tydaikho
Member
From: VietNam
Registered: 2010-09-20
Posts: 16
Website

Re: How can i add a class to list break tag?

I convert some to TXP template, i get some troubles with TXP tag.
Here is my tag code:
<p><txp:rss_auto_excerpt words=“60” linkclass=“more float_r” linkwraptag=“a” ending=”&nbsp;…” /></p>

with my tag code, i want the output below:
<a class=“more float_r” href=“http://abc/~hoangnm/textpattern/index.php?id=1” rel=“bookmark”>Read More…</a>

But i get the out put like:
<a class=“more float_r”></a>
<a href=“http://abc/~hoangnm/textpattern/index.php?id=1” rel=“bookmark”>Read More…</a>

when i replace “a” with “p” in linkwraptag=“p” :
<p><txp:rss_auto_excerpt words=“60” linkclass=“more float_r” linkwraptag=“p” ending=”&nbsp;…” /></p>
i get the output:
<p class=“more float_r”><a href=“http://127.0.0.1/~hoangnm/textpattern/index.php?id=1” rel=“bookmark”>Read More…</a></p>
not <a class=“more float_r” href=”…”>Read more…</a>

I am newbie with TXP, so i don’t know how to fix it… Someone help me pls. Thank you.

Last edited by tydaikho (2010-10-10 18:52:41)


http://vnsx.net | http://tydaikho.tk | http://txpblog.tk

Offline

#11 2010-10-10 20:26:20

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How can i add a class to list break tag?

tydaikho

  1. The plugin has a help text that is available as well in your Txp backend (Admin > Plugins) as here
  2. Questions about plugins are best posted in the plugin thread

That said, have a look at the showlinkwithexcerpt attribute, and the <txp:permlink> tag (hint: <txp:permlink class="more float_r">Read more</txp:permlink>).

Offline

#12 2010-10-10 20:32:55

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: How can i add a class to list break tag?

I think you are doubling up the code with your attributes. The link itself will always be an “a” tag so there is no need to specify it in the “linkwraptag” however, by default, the “linkwraptag” will use “p” tags so just leave it blank to override this like so – linkwraptag="".

Also there is no need to use “p” tags around the plugin tag. The excerpt will contain it’s own formatting so you will end up with “p” tags inside “p” tags if you do what you have done.

Last edited by thebombsite (2010-10-10 20:36:21)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB