Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-13 18:46:56

controlletti
New Member
Registered: 2008-07-13
Posts: 3
Website

sidebar disappears when using parameters in url

Hi!

I use textpattern for my private homepage since last year. It works fine. Now I try to develop an application in php inside textpattern. I used some forms and some $_GET and $_POST variables. And everything works still fine. To jump between pages I put some of these variables into the url and it still works. The articles consist of a head, sidebar, body and foot <div>. Now, if I call one of these sites without params, I see all of these four <div> with content. If I access to the same pages with params, the sidebar stays empty.

You can have a look here:

without params but with sidebar: http://www.dr.ueke.de/w_data
with params but without sidebar: http://www.dr.ueke.de/w_data?dJahr=2008&dMonat=7

Does anyone know, why the sidebar disappears and what to do to make it appear again?

Thanks in advance,

Bettina

Offline

#2 2008-07-13 20:19:37

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

Re: sidebar disappears when using parameters in url

Without knowing the contents of the templates/forms involved, I don’t think anyone can explain this.
Interesting is that it doesn’t matter which parameters you supply, because even if I just add a question mark at the end, the sidebar disappears: http://www.dr.ueke.de/w_data??

Offline

#3 2008-07-14 06:32:48

controlletti
New Member
Registered: 2008-07-13
Posts: 3
Website

Re: sidebar disappears when using parameters in url

Thanks for your quick answer! The template is quite simple:

<body>
<div id=“container”>
<!— head —>
<txp:output_form form=”#kopf_xxxx” />
<!— left —>
<div id=“sidebar-1”>
<txp:output_form form=”#navi” />
</div>
<!— center —> <div id=“content”> <txp:article form=“xxxx” limit=“1” pgonly=“0” sort=“Category1 asc” /> </div>
<!— footer —>
<div id=“foot”>
</div>
</body>

The article itself contains only <txp:output_form …> containing the php code.
The sidebar form named #navi contains also php code which performs some database queries to build a multi-level navigation structure.

If I view the gerated source code while viewing the page it contains the <div id=“sidebar-1”>…</div> when using no params – or just ? – and if it is used with params/? it is not there.

Offline

#4 2008-07-14 12:57:20

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

Re: sidebar disappears when using parameters in url

Offline

#5 2008-07-14 17:16:34

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

Re: sidebar disappears when using parameters in url

The sidebar form named #navi contains also php code which performs some database queries to build a multi-level navigation structure.

That’s where the problem lies, i think… in the PHP code of #navi. Can you post the contents of that form?

Offline

#6 2008-07-14 19:37:04

controlletti
New Member
Registered: 2008-07-13
Posts: 3
Website

Re: sidebar disappears when using parameters in url

@ Mary

Thanks for this link. I tried this and found out, that both versions of calling the site generated the same errors – the one with parameters generated less, because the only generated errors reported about not existent indices of my private $_GET-vars. I did not find any errors or difference in sidebar div. So I decided, this is no error caused by any conflicts with textpattern.

But in general knowing this feature is really great for identifying further difficulties.

@ ruud
That was the missing hint! I did not see this, because I coded this form named #navi long ago and it never made any problems, so I did not expect the fault to be here. My mistake was really simple: I compared $_SERVER[‘REQUEST_URI’] to the articles urls. Obviously the request_uri is different, when using params and obviously the version with params does not match with the articles urls saved in txp. So, now I divided the request_uri with explode(“?”,…) and – surprise, surprise – it works.

@ Both of you: Thanks a lot for this kind and quick help!!!

Offline

Board footer

Powered by FluxBB