Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#136 2008-10-01 19:41:25
Re: [plugin] [ORPHAN] rss_auto_excerpt
I’ve read througt the first five pages but I can’t find a solution to style the excerpt properly. Why isn’t it possible to assign a class to the excerpt?
Something like this would be perfect:
<txp:rss_auto_excerpt class="css-class" />
Offline
#137 2008-10-01 20:04:07
Re: [plugin] [ORPHAN] rss_auto_excerpt
How about this?
<wraptag class="css-class"><txp:rss_auto_excerpt /></wraptag>
Offline
#138 2008-10-01 20:15:27
Re: [plugin] [ORPHAN] rss_auto_excerpt
Of course I could write <div class="name"><txp:rss_auto_excerpt /></div> but that’s not a good solution…
I want something like this as output:
<p class="excerpt">This is the excerpt <a href="#">Read more</a></p>
Last edited by Viktor (2008-10-01 20:17:02)
Offline
#139 2008-10-01 20:41:04
Re: [plugin] [ORPHAN] rss_auto_excerpt
I see. Without striptags="1", the generated excert wraps a p element. You could do this:
<p class="excerpt"><txp:rss_auto_excerpt striptags="1" /></p>
…but then you lose any Textile/XHTML formatting within the excerpt.
Your best option is probably to target it in the page heirarchy. For example:
XHTML
<h3><txp:title /></h3>
<txp:rss_auto_excerpt />
CSS
h3 + p {
unique-style-declaration: ect;
}
If your article form appears in a specific div or other ided element, you can use that to further specify your css:
#article-list h3 +p {
If you make use of all the available selectors, you need class attributes less and less. I hope this helps!
Offline
#140 2008-10-01 20:44:29
Re: [plugin] [ORPHAN] rss_auto_excerpt
I noticed you can also use the excerptwraptag attribute in rss_auto_excerpt to generate a unique wraptag that can target with css.
Offline
#141 2008-10-02 12:05:41
Re: [plugin] [ORPHAN] rss_auto_excerpt
thank you, John. I solved my problem with your solution. I didn’t think of this way ;)
Offline
#142 2008-10-03 06:00:29
Re: [plugin] [ORPHAN] rss_auto_excerpt
You’re welcome. I’m glad you got it working!
Offline
#143 2008-11-17 19:03:44
Re: [plugin] [ORPHAN] rss_auto_excerpt
Sorry if this has previously been answered, but I couldn’t see it mentioned. I am trying to use this plugin to generate single paragraph excerpts and only want a ‘Read more’ link when the excerpt is shorter than the full text. However, I get the link whatever the length of the article. I am calling the plugin as follows:-
<txp:rss_auto_excerpt paragraphs="1" linktext="Read more" linkclass="readmore" />
Any fix for this would be much appreciated as it is a little annoying implying to visitors that there is more text to follow when there’s none.
Offline
#144 2008-12-04 19:56:46
Re: [plugin] [ORPHAN] rss_auto_excerpt
I am having problem with this plugin after upgrading to 4.0.7.
I am using
<txp:rss_auto_excerpt paragraphs="1" linktext="Lasīt tālāk" linkclass="morelink" />
and whenever I have an <txp:image id="xx" /> in my article body, page code is cut after returning content of plugin.
Offline
#145 2008-12-22 15:09:47
Re: [plugin] [ORPHAN] rss_auto_excerpt
Hi Papuass,
I ran into the same problem and did a bit of sleuthing… The issue may be connected to the strip-tags() function, however I think the problem lies more in tinkering with how textile is interpreting article contents.
If you use textile (or not) check to see if your article contents is poorly formed HTML – for example, if you have a carriage return (empty line) before your image tag, it is possible that the code itself looks like:
<p><img src="http://someimage.com/" /></p>
This causes the page to choke when rendering auto-excerpt. I was having the problem with DHTML Divs as well – nesting block level containers within in-line containers seems to be a no-no…
Remove the <p> tags from around your image and see if that solves the problem for you. It did for me.
UPDATE: I have to retract my statement… this plug-in has problems rendering anything with nested tags – legit or not.
In the case of textile autoformatting: this code causes a page halt:
<p><img src="http://some image/" /></p>
This can be resolved by throwing notextile. in front of the offending txp image tag… BUT -
<object etc><embed etc><param etc></param></embed></object>
also breaks the auto-excerpt and these nested tags seem unavoidable. So embedding any sort of flash/youtube content is not plausible. :-( Unless you put it lower in the page than autoexcerpt will go… like paragraph 3.
Last edited by jagorny (2008-12-23 01:27:22)
Offline
#146 2009-01-11 23:42:19
- jhwilliams
- Member
- Registered: 2007-01-04
- Posts: 13
Re: [plugin] [ORPHAN] rss_auto_excerpt
Hello -
I’ve never used a plugin before and I just can’t figure out how to use this. I tried to follow the instructions already posted on the forum and here is what is happening.
For my default page, I did this:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title><txp:page_title /></title>
<link rel=“home” href=”<txp:site_url />” />
<txp:feed_link flavor=“atom” format=“link” label=“Atom” /> <txp:feed_link flavor=“rss” format=“link” label=“RSS” />
<txp:css format=“link” />
</head>
<body id=”<txp:if_section name=“default”>front<txp:else /><txp:section /></txp:if_section>”>
<!— accessibility —>
<div id=“accessibility”>
<ul>
<li><a href=”#content”><txp:text item=“go_content” /></a></li>
<li><a href=”#sidebar-1”><txp:text item=“go_nav” /></a></li>
<li><a href=”#sidebar-2”><txp:text item=“go_search” /></a></li>
</ul>
</div>
<div id=“container”>
<!— head —> <div id=“head”> <center><txp:image id=“6” /></center></txp:link_to_home></h1>
</div>
<!— left —> <div id=“sidebar-1”>
<txp:section_list wraptag=“ul” break=“li” />
<txp:search_input wraptag=“p” />
<p><txp:feed_link label=“RSS” /> / <txp:feed_link flavor=“atom” label=“Atom” /></p> </div>
<!— right —> <div id=“sidebar-2”>
<img src=“http://speakingpictures.net/images/4.jpg”>
<txp:linklist wraptag=“p” />
<p><a href=“http://textpattern.com/”><img src=”<txp:site_url />textpattern/txp_img/txp_slug105x45.gif” width=“105” height=“45” alt=“Textpattern” title=”“ /></a></p> </div>
<!— center —>
<div id=“content”>
<txp:if_category>
<h2><txp:category title=“1” /></h2>
<div class=“hfeed”>
<txp:article limit=“7” searchsticky=“1” listform=“excerpt” />
</div>
<txp:else />
<txp:if_search>
<h2><txp:text item=“search_results” />: <txp:page_url type=“q” /></h2>
<div class=“divider”><img src=”<txp:site_url />images/1.gif” width=“400” height=“1” alt=”—-” title=”“ /></div> </txp:if_search>
<div class=“hfeed”>
<txp:article limit=“5” />
</div>
</txp:if_category>
<txp:if_individual_article>
<div class=“divider”><img src=”<txp:site_url />images/1.gif” width=“400” height=“1” alt=”—-” title=”“ /></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>
<!— footer —> <div id=“foot”> </div>
</div>
</body>
</html>
I made a form called “excerpt”:
<code>
<div class=“excerpt”>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:if_excerpt>
<txp:excerpt />
<txp:else />
<txp:rss_auto_excerpt length=“500” showlinkwithexcerpt=“0” />
</txp:if_excerpt>
</div><!—/excerpt—></code>
But when I go to my site, I get this error message at the top of the page:
Parse error: syntax error, unexpected T_STRING in /home/locustwi/public_html/speakingpictures/textpattern/lib/txplib_misc.php(574) : eval()’d code on line 1
The above errors were caused by the plugin:rss_auto_excerpt
What do I need to fix to have the plugin work properly?
Thanks very much,
Jennifer
Offline
#147 2009-01-21 02:12:46
Re: [plugin] [ORPHAN] rss_auto_excerpt
Any way to get the plugin to output a certain number of paragraphs, which include both the excerpt and the body? So if there are two paragraphs in the excerpt + nine in the body and I am limiting the output to three paragraphs, it would grab the two from the excerpt and the remaining one from the body.
Offline
#148 2009-03-09 05:13:06
Re: [plugin] [ORPHAN] rss_auto_excerpt
hmmm i’m getting some errors that don’t seem right;
<txp:rss_auto_excerpt linkclass="morelink" wrapreadmore=“1” />
produces:
Tag error: <txp:rss_auto_excerpt linkclass="morelink" wrapreadmore=“1” /> -> Textpattern Warning: Attribute values must be quoted on line 916
Tag error: <txp:rss_auto_excerpt linkclass="morelink" wrapreadmore=“1” /> -> Textpattern Warning: Attribute values must be quoted on line 916
Tag error: <txp:rss_auto_excerpt linkclass="morelink" wrapreadmore=“1” /> -> Textpattern Warning: Attribute values must be quoted on line 916
there are three articles so that’s why it repeated three times. if i remove wrapreadmore it disappears. had this with some other tag attributes as well.
Offline
#149 2009-03-09 12:14:54
Re: [plugin] [ORPHAN] rss_auto_excerpt
If what you’ve pasted here is exactly what you have in your template, it looks like the quotes on wrapreadmore are curly. Try this:
<txp:rss_auto_excerpt linkclass="morelink" wrapreadmore="1" />
Offline
#150 2009-03-10 23:22:59
Re: [plugin] [ORPHAN] rss_auto_excerpt
johnstephens wrote:
If what you’ve pasted here is exactly what you have in your template, it looks like the quotes on
wrapreadmoreare curly. Try this:
<txp:rss_auto_excerpt linkclass="morelink" wrapreadmore="1" />
ok thanks. i think the problem was i was copying and pasting off the help file, but i don’t understand what character that is then(curly)? well it’s fixed, and now i know better than to copy and paste next time ;)
Last edited by mrtunes (2009-03-10 23:23:20)
Offline