Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-03-30 14:39:48

WebKat
Member
Registered: 2007-01-16
Posts: 301

<txp: permlink /> not working right; css not being obeyed...

Hi there… I have an RSS feed from my LiveJournal that shows up on the front page of my site, here: http://opalcat.com/
It’s on the right side, under the heading “Most Recent Journal/Blog Entries”… My rss form is like this:

<h3><txp:permlink><txp:title /></txp:permlink></h3>
<blockquote>
	<p><txp:rss_auto_excerpt words="75" showlinkwithexcerpt="0" /></p>
	<p align="right" class="smallcaps"><em>~ <txp:posted /></em> &nbsp;&nbsp;<br>
	<span class="noprint"><txp:permlink>Go To Entry</txp:permlink> &rarr;</span><!--end noprint--></p>
	<p align="left"  style="font-size:.7em;"><txp:permlink /></p>
</blockquote>

Now the last permlink (the one where it’s a single tag) is supposed to be class=“print-only” (in my default css sheet: .print_only {display:none;})so that it only shows up when the print stylesheet is being called, but I have left the class off for now because the url wasn’t showing up correctly and I wanted to see it without having to hit “print” all the time to check it.

Now you’ll notice that I call the <txp:permlink> tag in two other places, once at the title and once at the “Go To Entry” link. In both of those cases, the url is correct. For example the current top post returns the url “http://opalcat.livejournal.com/2301729.html” in both of those spots.

However, you’ll see that the url that is displayed by the single <txp: permlink /> tag is returning this url: “http://opalcat.com//almost-done-with-two-paintings” which is obviously wrong, wrong, wrong. Why is it doing that?

The next weird thing that is happening, if you scroll through the other items in the journal RSS feed, is that the single <txp: permlink /> tag is returning that same “http://opalcat.com//almost-done-with-two-paintings” url for all of them, despite the fact that the tags that make the links to the title and the “Go To Entry” are returning the correct urls. Why is this happening?

Second question… The “Go To Entry” text link is like this in the form: <span class="noprint"><txp:permlink>Go To Entry</txp:permlink> &rarr;</span> and in my print css I have this: .noprint {display:none;} …yet when I click to print the page and see the page preview, it is there! Did I get the syntax wrong somewhere?

I’d really like to fix that <txp: permlink /> so that it shows the right url, so I can hide it again with my print_only class (also I don’t like a wrong url sitting out there for the world to see). The Go To Entry showing up on a printed page is annoying but not critical, so that is secondary.

In case it matters, here is how I call the feed in my page template:

<txp:rah_function call="strip_tags" allowed_tags="<p><a><em><strong><i><b><u><table><td><tr><th><thead><tbody><blockquote><span><div><form><input>">
	<txp:bit_rss feed="http://opalcat.livejournal.com/data/atom" limit="4" form="rss" wraptag="p" />
</txp:rah_function>

I needed the <txp:rah_function> because I frequently post images in my journal and it was seriously distorting them when it displayed them on my page. Plus they took up a lot of space.

Here are my stylesheets, if you need them to refer to:
default: http://opalcat.com/css.php?n=default
print: http://opalcat.com/css.php?n=print
Plugins installed: http://opalcat.com/Web/about-this-site (in case any of those is having an effect)

Can anyone help? Thanks in advance.

Last edited by WebKat (2012-03-30 14:41:38)



WebKat

Offline

#2 2012-03-30 15:28:29

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: <txp: permlink /> not working right; css not being obeyed...

Regarding the RSS, it looks like you are using the bit_rss plugin, and it seems to have problems with newer PHP versions. You might take a look at something like smd_xml to replace it. There are great examples on Stef’s site (like the Delicious links example) that would help you set it up.

Also, note that <txp:permlink /> is generally only for Textpattern-native articles, not external content from an Atom or RSS feed. I don’t know much about bit_rss, but it seems like that’s causing your link problem. In smd_xml, for example, you would place {link} in your form instead of <txp:permlink /> and it would print the LiveJournal link there.

I would try to fix that first, then work on the print issue, in case they are related.

Last edited by maruchan (2012-03-30 15:29:52)

Offline

Board footer

Powered by FluxBB