Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-04-16 22:18:02

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

[textile] [solved] Two questions about Textile

How can I make this link work in Textile "Esmeraldas":http://de.wikipedia.org/wiki/Esmeraldas_(Ecuador)? Textile doesn’t recognize the closing parenthesis as part of the URL.

How can I enter inside a text a image-ID so that this image is shown with the same form that I use to display a normal article image (with txp:images).

The form to display the article image:

<a href="<txp:image_url />" rel="gross" title="<txp:image_info />">
	<img src="<txp:image_url thumbnail="1" />" width="<txp:image_info type="thumb_w" />" height="<txp:image_info type="thumb_h" />" alt="<txp:image_info type="alt" />" />
</a>

Last edited by GugUser (2011-04-19 13:31:50)

Offline

#2 2011-04-16 22:28:05

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: [textile] [solved] Two questions about Textile

Solution to the first question with percent encoding for URIs: "Esmeraldas":http://de.wikipedia.org/wiki/Esmeraldas_%28Ecuador%29

Last edited by GugUser (2011-04-16 22:51:30)

Offline

#3 2011-04-18 01:35:49

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: [textile] [solved] Two questions about Textile

A solution to the second question could be "!/fotos/21t.jpg!":/fotos/21.jpg. But, how can I add the rel-attribute?

Offline

#4 2011-04-18 06:40:57

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: [textile] [solved] Two questions about Textile

But, how can I add the rel-attribute?

I’m not sure that that is part of textile … yet! There is a test branch of textile with rel support.

If you’re worried about the textile notation getting complex and are not averse to using a txp-style tag in a simplified form, e.g. <txp:lightbox_image id="123" />, perhaps the new smd_macro is worth a look?

Last edited by jakob (2011-04-18 06:42:22)


TXP Builders – finely-crafted code, design and txp

Online

#5 2011-04-18 14:37:41

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: [textile] [solved] Two questions about Textile

Thanks jakob for your answer.

The experimental versions of Textile I had forgotten. No, they are still not implemented in the official version.

Otherwise would be possible: "!/fotos/21t.jpg!(title){gross}":/fotos/21.jpg

I have assumed until now that Textile can’t process TxP-tags …

Ideal would be the following: enter the picture-ID and the form-name to display it, that would be very easy for the user. But, I have no idea how to do that.

Offline

#6 2011-04-18 15:38:59

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: [textile] [solved] Two questions about Textile

GugUser wrote:

Ideal would be the following: enter the picture-ID and the form-name to display it, that would be very easy for the user. But, I have no idea how to do that.

You could do that with something like this

<txp:output_form form='selected_form'>selected_image_id</txp:output_form>

Your form would then use <txp:yield/> in place of the image id.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#7 2011-04-18 17:05:02

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: [textile] [solved] Two questions about Textile

Thanks MattD for your answer.

I need to explain better the requirements. I display a blog article with the following simplified form:

<h2><txp:title /></h2><txp:if_article_image>
<txp:images auto_detect="article" break="" form="artikel-fotos-miniaturen" /></txp:if_article_image>
<txp:body />

The form “artikel-fotos-miniaturen” looks like this:

<a href="<txp:image_url />" rel="gross" title="<txp:image_info />"><img src="<txp:image_url thumbnail="1" />" width="<txp:image_info type="thumb_w" />" height="<txp:image_info type="thumb_h" />" alt="<txp:image_info type="alt" />" /></a>

This means that one or more article images are shown at the beginning of the article.

What I would like to realize is this: The author of an article can insert somewhere within the text a picture which is shown in the same way as defined by the form “artikel-fotos-miniaturen”. At any place within the article.

Offline

#8 2011-04-18 18:54:42

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: [textile] [solved] Two questions about Textile

Couldn’t they do <txp:images id='1' form='artikel-fotos-miniaturen'/>?

If the form is always the same you could use an smd_macro with code like

<txp:images id='{image}' form='artikel-fotos-miniaturen'/>

and the author would put

<txp:gug_insert_image image="1"/>

none of this tested so I could be way off

Last edited by MattD (2011-04-18 18:55:02)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#9 2011-04-19 13:30:08

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: [textile] [solved] Two questions about Textile

Yes, it works with the smd_macro plug-in. The only thing that the author must do is put this <txp:foto_einsetzen id="30" />.

Thanks Matt for the idea, and thanks Bloke for the ingenious plug-in.

Offline

Board footer

Powered by FluxBB