Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-05 12:11:38

mazso
Member
Registered: 2005-09-29
Posts: 25

[textile] p-tags around definition list

I like to put images into defintion lists like this

<code>
<dl>
<dt><<img …/></dt>
<dd>Caption</dd>
</dl>
</code>

because IMHO this is a very semantic way to connect image and caption. (To achieve this I’m hacking upm_image).

Up to TXP 4.0.3. this worked fine. Unfortunatally TXP 4.0.4. puts p-tags around the dl-list. So you will get the following code:

<code>
<p>
<dl>
<dt><<img …/></dt>
<dd>Caption</dd>
</dl>
</p>
</code>

These tags are unnecessary. What is worse: The beginning-plugin will not work correctly when the dl is surrounded by p-tags.

So I switched back to the classTextile.php, Version 4.0.3.

Mazso

Offline

#2 2006-11-05 17:29:07

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: [textile] p-tags around definition list

Use notextile.., then when you’re done with your defintion list, leave a blank line and use p. start reg paragraph. See this example

Offline

#3 2006-11-05 19:27:50

mazso
Member
Registered: 2005-09-29
Posts: 25

Re: [textile] p-tags around definition list

jm wrote:

Use notextile.., then when you’re done with your defintion list, leave a blank line and use p. start reg paragraph. See this example

Thank you, jm. I would like to implement this notextile-thing into the upm_image-plugin where I hacked the output:

<code>
$out = ‘<dl ‘.$class.’>
<dt>
<a href=”’.$the_url.$img.’” title=”<txp:if_category name=“en”>’
.upm_escape_html_atts($rs[‘alt’]).’</txp:if_category>
<txp:if_category name=“de”>’.upm_escape_html_atts($rs[‘caption’]).’</txp:if_category>” class=“popup”>’.’
<img src=”’.$the_url.$thumb.’”’.$w.$h.‘alt=”<txp:if_category name=“en”>’.upm_escape_html_atts($rs[‘alt’]).’
</txp:if_category><txp:if_category name=“de”>’.upm_escape_html_atts($rs[‘caption’]).’
</txp:if_category>” /></a>
</dt><dd></dd></dl>’;
</code>

But when I write:

<code>
$out = ‘notextile.. <dl ‘.$class.’>
</code>

and so on, Textile won’t render the notextile.. :-( Is there another solution? Because I don’t want to declare my client that from now on he has to type 1.) notextile.. 2.) include an image 3.) then type p. just to insert an image.

What I don’t understand: why is the new textile version wrapping <dl>, <bq> and so on into <p>-tags?

Offline

#4 2006-11-06 17:23:10

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [textile] p-tags around definition list

First, hacking the plugin isn’t necessary at all: use a custom form. Second, if you need to use the plugin from an article, you can do either:

 <txp:upm_image />
notextile. <txp:upm_image />

Offline

#5 2006-11-06 18:47:44

mazso
Member
Registered: 2005-09-29
Posts: 25

Re: [textile] p-tags around definition list

Mary wrote:

First, hacking the plugin isn’t necessary at all: use a custom form. Second, if you need to use the plugin from an article, you can do either:

 <txp:upm_image />
notextile. <txp:upm_image />

Thank you, Mary. And when I hack your plugin that doesn’t mean any criticism – upm_image and ump_image_poppper are one of my favourites plugins. I use them on five txp-installations.

But I also like the idea of using definitions lists for images and captions. And in the above mentioned case I needed a solution to use the Jquery/Thickbox-thing and that on a two language page.

Nevertheless I don’t understand what could be the benefit of wrapping dl’s and so on in p-tags.

Mazso

Last edited by mazso (2006-11-06 18:48:15)

Offline

#6 2006-11-06 19:07:34

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [textile] p-tags around definition list

But I also like the idea of using definitions lists for images and captions.

I repeat: use a custom form. Why hack when you don’t need to?

Nevertheless I don’t understand what could be the benefit of wrapping dl’s and so on in p-tags.

There is no “benefit”. You’re using Textile, and that’s what it does – it wraps stuff in paragraphs.

Offline

#7 2006-11-09 19:24:05

The-Exit
Member
From: Berlin
Registered: 2005-07-16
Posts: 175
Website

Re: [textile] p-tags around definition list

Although this thread has a different title, I have a similar problem.

As already pointet out in the ump_image thread, the 4.0.4 textile will wrap a tag like <txp:upm_image image_id="2113" form="lightbox" /> with a p-tag.

The notextile seems to be a workaround, but from a usability point of view, I’d rather prefer the behaviour we know from the 4.0.3 textpattern. Or, Mary, are you planning to integrate a “notextile”-feature into the popper?

Offline

#8 2006-11-10 19:49:38

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [textile] p-tags around definition list

Or, Mary, are you planning to integrate a “notextile”-feature into the popper?

It’s not possible.

Offline

#9 2006-11-10 20:17:04

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [textile] p-tags around definition list

The-Exit wrote:

As already pointet out in the ump_image thread, the 4.0.4 textile will wrap a tag like <txp:upm_image image_id="2113" form="lightbox" /> with a p-tag.

As far as I know and remember, this behaviour is correct since older TxP version.
If, in the write tab, you start to write a line without an blank space in front, that line will be wrapped within a p tag. Even if the line starts with an XHTML/txp tag.
The-Exit, in your post in the other thread, you say that leaving a blank space is a workaround, but AFAIK, that solution has been always the “official” solution to avoid lines being wrapped by a p tag.

But… wait… as I’m writting this, it seems that some things have been changed.

From the FAQ Common Textile Questions

Q: Textile interferes with raw HTML in my article body

Textile tries to leave raw HTML alone. In most cases, an enclosed block of well-formed raw HTML like this will be left untouched:

<div class=“foo”> <span>blah</span> </div>

However, blank lines within the block will result in unwanted <p>…</p> blocks and <br /> tags.

Blocks of HTML code that are completely enclosed by a tag will not be enclosed by <p>…</p> tags. A line that includes both HTML and unenclosed text will be processed as normal paragraph text.

I have been testing this a bit, and it seems that it only works with <div></div> wrapped blocks.
It doesnt work for other HTML tags and neither for TxP tags.

So, one solution is still leaving an empty space at the start of the line.

Last edited by maniqui (2006-11-10 20:17:37)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#10 2006-11-10 23:36:58

zem
Developer emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579
Website

Re: [textile] p-tags around definition list

I have been testing this a bit, and it seems that it only works with <div></div> wrapped blocks.
It doesnt work for other HTML tags and neither for TxP tags.

Please test here and report bugs. The best way to guarantee a bug won’t be fixed is to not report it.


Alex
tstate

Offline

Board footer

Powered by FluxBB