Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-08-16 11:17:15

Paulo
Member
Registered: 2008-08-02
Posts: 18

Problem with my code?

I’m testing textpattern locally with mamp and everything has gone well until now. I’ve some images (all in the images folder ) but some of them are rendered by the browser.
Some examples:

<div id="header">

<h1 id="logo"> 
   <a href="#" title="Testing Site">
    <img src="/textpattern/images/logo.jpg" alt="Logo" width="174" height="35"/></a>
</h1>
<ul id="main-nav">
<txp:cbs_navigation_menu
sections="default,work,contact"
titles="Home,Work,Contact"
break="li"
activeclass="active"
wraptag=""
ids="first,," />
</ul>
</div>

And then i call the form on the page: <txp:output_form form="header+nav" /> and the logo image is rendered.
However with the following code the image is not rendered.

Form:

<div id="extra-content">
    <div class="grafico">
<img src="/textpattern/images/sucesso1.png" alt="image of sucess" width="350" height="338" />
     </div>
</div>

Page:

<div id="extra-content">
	<div class="grafico">
         <txp:output_form form="extra-content" />				
	</div>
</div>

Last edited by ruud (2008-08-16 11:41:31)

Offline

#2 2008-08-16 11:42:48

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Problem with my code?

Does the resulting page have the correct HTML code?

Offline

#3 2008-08-16 11:52:15

Paulo
Member
Registered: 2008-08-02
Posts: 18

Re: Problem with my code?

Yes because if i insert raw html instead of the txp derm code the page renders well.

Last edited by Paulo (2008-08-16 11:56:59)

Offline

#4 2008-08-16 12:34:34

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Problem with my code?

Please post the URL for the page that demonstrates the problem and/or try setting your TXP website in debug mode (admin -> preferences) and check the tag trace at the bottom of the HTML code.

Offline

#5 2008-08-16 13:05:42

Paulo
Member
Registered: 2008-08-02
Posts: 18

Re: Problem with my code?

I don’t understand what you mean with debug (noob i know) so i’ll try to put the page live.

Offline

#6 2008-08-16 13:41:18

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

Re: Problem with my code?

ruud wrote:

try setting your TXP website in debug mode (admin -> preferences)

Click the admin tab. Click the preferences tab. Where it says “Production status,” select “Debugging.” Save.

Offline

#7 2008-08-16 14:28:40

Paulo
Member
Registered: 2008-08-02
Posts: 18

Re: Problem with my code?

jm wrote:

Click the admin tab. Click the preferences tab. Where it says “Production status,” select “Debugging.” Save.

This i understand. What i don´t understand is what to do after :)

Offline

#8 2008-08-16 14:56:36

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Problem with my code?

Go to the problem page and obtain its source code. In debug mode the tag trace is appended to the end of the HTML listing.

Offline

#9 2008-08-16 15:09:21

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

Re: Problem with my code?

Diagnosing template problems – see the “Check the tag trace” heading (Ruud, wet – can either one of you add an ID/anchor to that?).

Offline

#10 2008-08-16 15:26:22

Paulo
Member
Registered: 2008-08-02
Posts: 18

Re: Problem with my code?

Here’s the trace. I don´t understand any of this :(

<!-- Runtime:    0.0095 -->
<!-- Query time: 0.005192 -->
<!-- Queries: 16 -->
<!-- Memory: 2010Kb, <txp:output_form form="footer" /> -->
<!-- txp tag trace: 
[SQL (0.001722): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.000152): select name, code, version from txp_plugin where status = 1]
[SQL (0.000147): select name from txp_section where `name` like 'home' limit 1]
[SQL (0.000131): select * from txp_section where name = 'home' limit 1]
[SQL (0.000212): select host from txp_log where ip='::1' limit 1]
[SQL (0.000255): insert into txp_log set `time`=now(),page='/textpattern/home/',ip='::1',host='::1',refer='',status='200',method='GET']
[SQL (0.000120): select user_html from txp_page where name='qoska']
[Page: qoska]
<txp:output_form form="meta" />
	[SQL (0.000177): select Form from txp_form where name='meta']
	[Form: meta]
<txp:output_form form="header+nav" />
	[SQL (0.001182): select Form from txp_form where name='header+nav']
	[Form: header+nav]
	<txp:cbs_navigation_menu
sections="default,work,contact"
titles="Home,Work,Contact"
break="li"
activeclass="active"
wraptag=""
ids="first,," />
<txp:output_form form="welcome-msg-home" />
	[SQL (0.000122): select Form from txp_form where name='welcome-msg-home']
	[Form: welcome-msg-home]
<txp:output_form form="who-i-am" />
	[SQL (0.000126): select Form from txp_form where name='who-i-am']
	[Form: who-i-am]
<txp:output_form form="what-i-do" />
	[SQL (0.000103): select Form from txp_form where name='what-i-do']
	[Form: what-i-do]
<txp:output_form form="how-i-do-it" />
	[SQL (0.000100): select Form from txp_form where name='how-i-do-it']
	[Form: how-i-do-it]
<txp:output_form form="extra-content" />
	[SQL (0.000099): select Form from txp_form where name='extra-content']
	[Form: extra-content]
<txp:output_form form="footer" />
	[SQL (0.000105): select Form from txp_form where name='footer']
	[Form: footer]
[ ~~~ secondpass ~~~ ]
 -->

Sorry for being such a noob. But i’m liking Textpattern so much that i want to try understanding this things.
If that means any sense for you guys.

Last edited by Paulo (2008-08-16 15:26:57)

Offline

#11 2008-08-16 17:24:39

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

Re: Problem with my code?

The tag trace shows you what textpattern has done and rendered. You can see it’s using the page ‘qoska’, which forms it has retrieved from the database and output etc. If you have used txp:if... conditionals tag you will see “true” if it applies, “false” if not and so on. It’s a good way of tracing what txp has processed. In short, your tag trace seems okay and shows that the form extra-content has been processed which means you should have the relevant HTML in your page source.

Have you checked the image names are correct? I’m just asking because images uploaded to the image pane in txp are renamed numerically, e.g. 1.jpg, 2.png etc. so if you uploaded sucesso1.png via the image tab the actual file will therefore have another name such as 2.png where 2 is the image-ID#.

If the HTML generated by txp is correct and the image is in the folder, see if the ‘firebug’ extension for firefox can help you diagnose the problem. Load up your page and switch to the “net” pane to see if that tells you why the image is not being found (e.g. wrong path or wrong name). If it doesn’t show an error but your image still doesn’t appear on screen, maybe your css is responsible for it not showing (you can disable css with the firefox web developer extension to check this too). [ If you use Safari, it has something similar called the ‘network timeline’ as well as ‘disable styles’ in the develop menu (you have to switch on the develop menu in the prefs). ]

BTW: if the information you posted above is correct, you will get a duplicate-ID validation error because your have <div id="extra-content"> in both the page template and form. That shouldn’t be the reason for the image not showing but making sure your code is valid will help too.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2008-08-16 17:54:55

Paulo
Member
Registered: 2008-08-02
Posts: 18

Re: Problem with my code?

Thank you for the clarification. Apparently was because the duplicate #ID of the <div id="extra-content"> because after i remove it from the page, the image was rendered right away.
Thank you all for the help :)

Offline

Board footer

Powered by FluxBB