Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-12 03:02:04

Jack
Member
Registered: 2005-10-10
Posts: 14

Directory of article page?

Hi everyone

I’m using textpattern for the first time on a client site, and I’ve run into a small issue.

There are some image replacement scripts that I use for the site, and I’ve put them on the same level as the top level index.php file. The problem is that the link to the script breaks when I access the article level pages, presumably because the page is somewhere else in the textpattern file structure. At first I thought it was the index.php file in the “textpattern” directory, but I’ve copied the files there and it doesn’t seem to work.

any help would be appreciated

Jack

Offline

#2 2006-03-12 03:24:32

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

Re: Directory of article page?

The index.php file and the index.php found inside the Textpattern folder are two different files, so make sure you put them back the right way (grabbing fresh copies of those two files from the .zip is probably the simplest way).

This problem isn’t Textpattern-specific: you’re entering incorrect url(s)/path(s) in/for your image replacement scripts.

I’m moving this thread to “How Do I…?”, please provide more details so someone can help you find the correct settings.

Offline

#3 2006-03-12 04:04:05

Jack
Member
Registered: 2005-10-10
Posts: 14

Re: Directory of article page?

sorry, I guess my description was a little vague. I can’t give out the url because of the nda, so I’ll do my best to describe it again.

My understanding:

root/index.php is the front page
root/textpattern/index.php is the article page[?]

I have two copies of the script in the root and /textpattern directory (to maintain the relative links), but the script still does not work on the article page. This tells me that /textpattern/index.php is not the article page because the links would work if it was. I’m just wondering where I should put my second copy of the scripts to preserve the links, if not in the /textpattern directory.

I have to put the scripts in whatever directory the page is in, so that the relative links would still work. I just don’t want to make a separate template with correct links for the article pages.

hope that was a bit more clear

Offline

#4 2006-03-12 04:26:33

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

Re: Directory of article page?

I take it this is a JavaScript?

What you’d do is put your script in your root directory. Then, within your page you’d link to /script_name. The starting slash is important, it tells your browser that regardless of where you are in the site, load the script in the root directory.

Offline

#5 2006-03-12 05:22:32

Jack
Member
Registered: 2005-10-10
Posts: 14

Re: Directory of article page?

thanks, that works great. Although I still wonder where the article page is..

I really should know this stuff by now :]

Offline

#6 2006-03-12 05:39:32

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Directory of article page?

It’s my understanding (correct me if I’m wrong). That every page that TXP generates is in the root directory of the TXP install regardless of whatever URL scheme is employed. The textpattern index page in root/Textpattern runs the TXP interface.

Offline

#7 2006-03-12 06:11:56

Jack
Member
Registered: 2005-10-10
Posts: 14

Re: Directory of article page?

hm.. but in that case the relative links should have worked in the first place. I think a separate php file is used for sub level pages.

thanks for the help

Offline

#8 2006-03-12 11:12:58

Jack
Member
Registered: 2005-10-10
Posts: 14

Re: Directory of article page?

actually, there was another thing that I was meaning to ask about.

The navigation links in my article level pages seems to be broken. They would point to www.domain.com/blog/5/about-me, when it really should say www.domain.com/about-me

in this case I would be on the blog section, trying to access the about-me section

maybe this is related to my other problem? It looks like the links are just shifted a few levels down.

thanks, I’m still pretty new at this..

Last edited by Jack (2006-03-12 11:27:31)

Offline

#9 2006-03-12 13:03:33

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: Directory of article page?

<blockquote>I think a separate php file is used for sub level pages.</blockquote>

Unless I’m mistaken, Textpattern doesn’t care about any directories than the one its installed in. All URL’s are dynamically generated, and it “fakes” the directory structure to begin with, so it doesn’t make sense to me that it’d use different scripts based on which “level” it’s in.

<blockquote>www.domain.com/blog/5/about-me, when it really should say www.domain.com/about-me</blockquote>

Make sure you’ve correctly selected the permalink mode of your choice (under Admin —-> Prefs). From the look of it, you wanted <strong>/title</strong> but selected <strong>/section/id/title</strong>

Offline

#10 2006-03-12 13:07:04

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

Re: Directory of article page?

index.php serves your entire site. Textpattern emulates directory structure, that is, the browser cannot tell that domain.com/blog/5/about-me is actually www.domain.com/index.php?id=5. That’s the magic of mod_rewrite (the Apache web server module that does this faking).

You want to change your permalink setting (admin prefs). The setting you will want is /section/title; I wouldn’t recommend /title, that won’t do what you want.

FAQ: How do I managed static pages?, i.e: domain.com/about-me

Offline

#11 2006-03-12 19:01:03

Jack
Member
Registered: 2005-10-10
Posts: 14

Re: Directory of article page?

Textpattern emulates directory structure, that is, the browser cannot tell that domain.com/blog/5/about-me is actually www.domain.com/index.php?id=5.[how do you quote..]

but then I still don’t understand why my relative links were broken, if only the single index.php is used. I knew that it used the top level index.php for all the major section pages, but when the links broke in the article level pages I figured it must be a special case that used a separate file.

Actually /id works great. The url now looks like www.domain.com/example-blog-entry?s=writings (when going from example-blog-entry to the writings page) It’s not pretty but it functions as expected.

I would have liked the organization of /section/title, but it had the same problem as before – it goes to domain.com/blog/writings instead of domain.com/writings

thanks, and I think I’m getting the hang of things now :]

Offline

#12 2006-03-12 20:07:19

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: Directory of article page?

<blockquote>I would have liked the organization of /section/title, but it had the same problem as before – it goes to domain.com/blog/writings instead of domain.com/writings</blockquote>

Just to be clear: if you have a section called blog and and article called writings, that behavior is expected because every article is under a section. Articles themselves do not act as singular sections.

And feel free to use HTML in your posts; I use the blockquote tag to quote.

Last edited by Elenita (2006-03-12 20:08:55)

Offline

Board footer

Powered by FluxBB