Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#133 2006-12-28 00:24:06

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

Re: [plugin] [ORPHAN] upm_image: More powerful image display

I think you have a problem here:

<txp:if_custom_field>
<div id="photos">
<txp:article form="photolist" />
</div> <!-- photos -->
</txp:if_custom_field>

You can’t evaluate a custom field in a page article template. Custom fields are an article feature and so, the if_custom_fields tags will only work in an article form (this are the forms you call from an <txp:article form="myform" /> tag.
Maybe (Mary could confirm) the txp:if_custom_field tag can be used inside an individual-article context page template.

Finally: <txp:article id="5" />.
I think that tag doesn’t accept the id attribute. You should use <txp:article_custom id="5" />


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#134 2006-12-28 00:55:07

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

k thanks, I tried removing the txp:if_custom_field and it doesn’t seem to make a difference. The output code is still only the empty div with id=photos. Can anyone tell me whether the code for the forms itself is correct. If it is, it really does seem that I am only calling them the wrong way… Or maybe I am doing something else wrong…?!?!?

Offline

#135 2006-12-28 07:32:29

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 256
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Where did you place the photo form? I can’t find it in your page template…


Prrrrrrrr

Offline

#136 2006-12-28 12:57:46

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

ok, it seems like I am missunderstanding the whole concept. Can somebody please outline how to use upm_image, which form has to reference to which form, how it is called etc.
The code that I have above, called a form photolist that called the form photo, but that doesn’t work. (at least the way I did it.)

Offline

#137 2006-12-28 18:06:43

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

Re: [plugin] [ORPHAN] upm_image: More powerful image display

I don’t support asy_wondertags, so I can’t say anything about it. If I were you, I would first check that supplying an id actually works:

page:

<txp:output_form form="header" />

<div id="content">

	<div class="left">
		<txp:output_form form="menu" />

		<ul class="articlemenu">
		<txp:article_custom allowoverride="0" form="articlelist" pgonly="0" section="aktuelle-ausstellung" sort="Title asc" />
		</ul>
	</div>

	<txp:article id="5" />
</div>

<div id="photos">
	<txp:article form="photolist" />
</div>

<txp:output_form form="footer" />

photolist:

<!-- use the ID of an existing image -->
<txp:upm_image form="photo" id="5" />

photo:

<div>
	<div class="caption">
		<h3><txp:upm_img_name /></h3>

		<txp:upm_img_caption wraptag="p" />
	</div>

	<img src="<txp:upm_img_full_url />" alt="<txp:upm_img_alt escape="html" />" />
</div><br />

Offline

#138 2006-12-28 21:53:55

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

nope, that doesn’t work either. I tried changing the form types, too, but that doesn’t change the result. At the moment I have the form photolist set to ‘article’ and the form photo to ‘misc’. Is this the right way to do it? (Somewhere, I have read that there should be a form type called ‘image’, but I cannot find one like that… eh?)

Bytheway: I changed txp:upm_image to txp:upm_article_image for a test. That works perfect, but of course only with the wrong image. (I need to display multiple images, which are defined in multiple custom fields. Also I already have an article image…)

Last edited by dl33 (2006-12-28 21:57:39)

Offline

#139 2006-12-28 22:13:12

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

Re: [plugin] [ORPHAN] upm_image: More powerful image display

At the moment I have the form photolist set to ‘article’ and the form photo to ‘misc’. Is this the right way to do it? (Somewhere, I have read that there should be a form type called ‘image’, but I cannot find one like that… eh?)

No, the form type doesn’t affect the form functionality at all. Form types are just for the sake of categorization the different forms.

Bytheway: I changed txp:upm_image to txp:upm_article_image for a test. That works perfect, but of course only with the wrong image. (I need to display multiple images, which are defined in multiple custom fields. Also I already have an article image…)

Considering that you are calling an article form (because you are using <txp:article form="photolist" />, txp:upm_article_image should be the correct one to do the job.
What I don’t understand is why are you using multiple custom fields for each image.
This plug-in supports a list of images ID that will be iterated for each image.

If you take a second look at the plug-in help you will find out how to do it.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#140 2006-12-29 00:06:15

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Actually I am not using multiple custom fields for each image. I make textpattern go through all custom fields, and use the id (of an image) that they contain to display multiple images. So custom field 1 might contain one id of an image, while the next one contains another one. The reason why I am using upm_image is that it seems to be the only way to display the name and description of an image, saving me some custom fields and allowing me to display more images for one particular article… I am not sure if there is perhaps a better plugin for me to use…

Offline

#141 2006-12-29 03:28:45

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

Re: [plugin] [ORPHAN] upm_image: More powerful image display

Post a tag trace.

Offline

#142 2006-12-29 13:04:44

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

jup here it is…:
<!-- txp tag trace:
[SQL (0.001219): select name from txp_lang where lang='en-gb' limit 1]
[SQL (-0.199157): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.005246): select name, code, version from txp_plugin where status = 1]
[SQL (-0.206373): select ID, Section from textpattern where ID = 7 and Section = 'aktuelle-ausstellung' and Status >= 4 limit 1]
[SQL (0.000888): select * from txp_section where name = 'aktuelle-ausstellung' limit 1]
[SQL (0.001713): select *, unix_timestamp(Posted) as uPosted from textpattern where ID=7 and Status = 4]
[article 7]
[SQL (0.001257): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted > '2006-12-24 06:33:37' and Section = 'aktuelle-ausstellung' and Status=4 and Posted < now() order by Posted asc limit 1]
[SQL (0.000883): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted < '2006-12-24 06:33:37' and Section = 'aktuelle-ausstellung' and Status=4 and Posted < now() order by Posted desc limit 1]
[SQL (0.001112): select host from txp_log where ip='82.168.231.164' limit 1]
[SQL (0.001002): insert into txp_log set `time`=now(),page='/aktuelle-ausstellung/7/das- buch',ip='82.168.231.164',host='82-168-231-164.dsl.ip.tiscali.nl',refer='',status='200',method='GET']
[SQL (0.000994): select user_html from txp_page where name='Ausstellungsstücke']
[Page: Ausstellungsstücke]
<txp:output_form form="header" />
[SQL (0.211446): select Form from txp_form where name='header']
[Form: header]
<txp:sitename/>
<txp:site_slogan/>
<txp:css format="link" />
<txp:image id="2"/>
[SQL (0.000769): select * from txp_image where id = 2 limit 1]
<txp:output_form form="menu" />
[SQL (0.000571): select Form from txp_form where name='menu']
[Form: menu]
<txp:section_list include_default="0" class="menu" active_class="activemenu" wraptag="ul" break="li" sections="home, aktuelle-ausstellung, wegbeschreibung, kalender, bestellen, kontakt, links"/>
[SQL (0.000708): select name, title from txp_section where name in ('home','aktuelle-ausstellung','wegbeschreibung','kalender','bestellen','kontakt','links') order by field(name, 'home','aktuelle-ausstellung','wegbeschreibung','kalender','bestellen','kontakt','links')]
<txp:article_custom allowoverride="0" form="articlelist" pgonly="0" section="aktuelle-ausstellung" sort="Title asc" />
[SQL (0.021679): select *, unix_timestamp(Posted) as uPosted from textpattern where 1 and Status = 4 and Posted <= now() and Section = 'aktuelle- ausstellung' order by Title asc limit 0, 10]
[SQL (0.005165): select Form from txp_form where name='articlelist']
[Form: articlelist]
[article 7]
<txp:glx_hl_current_article class="activemenu"/>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 17]
<txp:glx_hl_current_article class="activemenu"/>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 10]
<txp:glx_hl_current_article class="activemenu"/>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 8]
<txp:glx_hl_current_article class="activemenu"/>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 11]
<txp:glx_hl_current_article class="activemenu"/>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 9]
<txp:glx_hl_current_article class="activemenu"/>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article id="5" />
[SQL (0.006099): select *, unix_timestamp(Posted) as uPosted from textpattern where ID = 7 and Status = 4 limit 1]
[article 7]
[SQL (0.000476): select Form from txp_form where name='default']
[Form: default]
<txp:title/>
<txp:article_image class="articleimg"/>
[SQL (0.000634): select * from txp_image where id = 3]
<txp:body/>
<txp:article form="photolist" />
[SQL (0.001594): select *, unix_timestamp(Posted) as uPosted from textpattern where ID = 7 and Status = 4 limit 1]
[article 7]
[SQL (0.002423): select Form from txp_form where name='photolist']
[Form: photolist]
<txp:upm_image form="photo" id="4" />
<txp:output_form form="footer" />
[SQL (0.002955): select Form from txp_form where name='footer']
[Form: footer]
<txp:php>
</txp:php>
[ ~~~ secondpass ~~~ ]
-->

Offline

#143 2006-12-30 02:24:08

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

Re: [plugin] [ORPHAN] upm_image: More powerful image display

If you change your Production mode to Testing or Debugging, do you get any errors/warnings?

Offline

#144 2006-12-30 13:01:39

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: [plugin] [ORPHAN] upm_image: More powerful image display

nope, none at all…
Perhaps you can give me a couple of working examples so that I can copy some code… I think that might also be a good idea if examples like this would be included in the doumentation, since, as you can see, there is always the one or the other dumbo that doesn’t get it.

Last edited by dl33 (2006-12-30 13:04:07)

Offline

Board footer

Powered by FluxBB