Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-12-03 21:16:22

ajw-art
Member
Registered: 2010-02-10
Posts: 33

The scrambled link: I've angered the TXP gods, but I'm not sure why.

So, here’s what went down.

For the last two weeks I’ve been working on my new portfolio site. TXP has been performing marvelously, as it usually does once I’ve figured out the logical way to get it to do what I want.

Fast forward to today. I’m a bit of a lazy bones, so I decided it was high time to install a WYSIWYG editor for the article write screen so I wouldn’t have to write out formatting code anymore. I chose hak_tinymce. Installed it, used it, no problems. I decided to test it on a pre-existing (Textile formatted) article, as I’d missed the little bit in the plugin instructions that would’ve told me doing so was a Very Bad Thing. Woops.

Fast forward again. I re-disabled hak_tinymce on the article in question, re-formatted the article for textile, and everything was roses once more… or so I thought.

For you see, there’s a link on the page that worked perfectly well until the enabling/disabling tinymce debacle happened. Now when I try and enter it into the article, TXP converts the quotes to HTML entities and the rest of the page load fails. While I can’t say for certain that hak_tinymce’s effect on the article was the culprit, I will say that links using similar formatting work in every other place they appear on the site.

The link in question is this:

<a href='<txp:section name="contact" url="1" link="0" />' class="button nice blue round large columns four">Tell Me About Your Project</a>

As per usual, when I insert it into the article I add one space before the opening of the <a> tag to disable Textile for that line. No dice on the output end. And the only thing the debug log is telling me is, ‘You screwed up so badly I can’t even process it anymore.’ I’ve tried pasting the tag into Notepad ++ to highlight any funky foreign characters, I’ve tried re-typing it and pasting it back into the article, and still nothing. Where did I go wrong, Textpattern gurus?

EDIT: The plot thickens— removing the embedded <txp: section /> tag in the href attribute allows the page to render without issue. I just don’t understand why the <txp:section /> tag is causing a problem all of a sudden, and only on this page.

EDIT #2: Okay, so explicitly using notextile. before the tag got it working again. My question is, why? I haven’t used notextile once in the two or three years I’ve been working in Textpattern. The standard extra space at the start of a new line has always achieved the desired behavior just fine, and in fact it’s working fine throughout the rest of the article. I’m puzzled.

Last edited by ajw-art (2011-12-03 23:46:14)

Offline

#2 2011-12-04 03:01:38

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: The scrambled link: I've angered the TXP gods, but I'm not sure why.

The leading space tells Textile not to wrap the block in a paragraph element, but it doesn’t disable Textile’s parsing for phrase modifiers or smart punctuation.

The three ways to tone done Textile within an article do three separate things. notextile. and notextile.. disable all Textile parsing within the designated blocks. The leading space eliminates paragraph-wrapping without disabling Textile, and surrounding a phrase in ==double equals== disables Textile for that phrase only.

Offline

#3 2011-12-04 04:00:58

ajw-art
Member
Registered: 2010-02-10
Posts: 33

Re: The scrambled link: I've angered the TXP gods, but I'm not sure why.

Okay, that makes sense; I thought the leading space was synonymous with notextile and the wrap. Looking back through the code in the same article, though, there’s another instance where I used just the leading space to prevent it from wrapping <div class="columns eight">, yet the class attribute didn’t turn into garbled junk. I’m guessing my problem with the URL had to do with the TXP tag embedded inside of it? I’m just not sure why Textile would screw up the formatting of that specific bit of code when it rendered the URL correctly if the <txp:section /> tag wasn’t included.

Offline

#4 2011-12-05 23:58:11

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

Re: The scrambled link: I've angered the TXP gods, but I'm not sure why.

This is just an “of the top of my head listening to Hendrix” type thought but this isn’t a tag-within-tag situation so assuming the code you quote above is accurate I’m thinking there should be double-quotes around the “href” value???

Textile can be a bit of a pain with “a” type links so as John suggests above I generally go with the ==double equals==.


Stuart

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

Offline

Board footer

Powered by FluxBB