Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2006-02-09 13:38:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: [archived] gbp_faux_static - uri forwarding.

Hi, this plugin looks uber-powerful and could be just what I need. Hacking around with various values and stuff I’ve had limited success and I’m struggling a little doing the following. I wonder if it’s at all possible or if I’m just being dense.

I’d like to create a surfer-friendly structure that allows somebody to type in the address bar something like:

domain.com/events – to show a page listing all events (pretty easy!)
domain.com/events/2005 – to show a page listing events in 2005
domain.com/events/2005/07 – to show a page listing events in July 2005
domain.com/events/2005/07/08 – to show a page listing event(s) on 8th July 2005
domain.com/events/2005/07/08/event-title – to show a specific event (redirects to domain.com/events/event-title and shows the article)

all with or without a trailing slash. And I guess I’ll have to give out a “no events found” type message if that’s the case.

So essentially, all the events are actually articles stored directly in the “events” section and can all be accessed directly with domain.com/events/event-title. But I’d like to give people different “views” so they can use the address bar to show events by date, by artist, by category etc etc. E.g. using domain.com/events/megasquid would list all events for the artist megasquid (the artist name is set as category1 in the article), or domain.com/events/albums might show all album releases (the event “type” is category2). I wonder if domain.com/events/megasquid/albums might be able to show all albums by megasquid (i.e. cat1 AND cat2)… you get the idea.

It would be nice, in the event of a typo, if the URL the user got was one level “back up” the tree as far back as makes sense so they’re still close to their intended destination (i.e. domain.com/events/2005/07/98 would realise that 98 isn’t a real day and would drop them back to the “July 2005” view. But I don’t mind redirecting any bogus (404) article names to the root domain.com/events.

I’ll probably be adding some form of filter to show “future” and “past” events, and the filter by location/event type/artist/etc will probably be done with the if_different tag and some custom sections like Stuart does. I’ve set up some sections named eventdates, eventartists and so on and pointed them to a form that does conditional branching to allow people to browse by date/category/whatever, as Stuart outlines in that excellent article. I just can’t help thinking there’s a way to achieve some or all this functionality by using this plugin.

I tried a few regexp patterns such as:

%^\/(?#section name=events)\/(?#year)\/(?#month)\/(?#day)\/(?#title)\/$%
and setting the permanent URI format to:

/(?#title)/

and I just get a 404. Am I being thick? Anybody any ideas on if what I’m proposing is possible and how I’d begin to go about it? Am I trying to push poor TextPattern too far? Should I split the functionality up somehow? Some gentle prodding/ideas from people with greater minds than mine might make the penny drop in my little brain.

Many thanks in advance.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#62 2006-02-15 10:41:41

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: [archived] gbp_faux_static - uri forwarding.

I’m feeling super stupid. i’m trying to make this work for section/category/title but am getting nowhere.

i tried to follow the instructions in this post , but i’m not getting anywhere. links from the front page give me 404’s.

can somebody explain this plugin to someone with no clue on regular expressions?


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#63 2006-02-19 21:25:59

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: [archived] gbp_faux_static - uri forwarding.

anyone? anyone? bueller? ;)


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#64 2006-02-21 04:41:17

robert1
Member
From: Passau
Registered: 2005-08-07
Posts: 51
Website

Re: [archived] gbp_faux_static - uri forwarding.

I think this plugin could get my favorite one. Great idea and coding! Thank You.

However, I don’t understand it already – because my regexp-skills are not very well. I’ve read the posts almost three times and tried some possible combinations. But it does unfortunately not work for me.

I’ve got three problems – many others have too, I guess.
My TXP-permlink-scheme ist /section/title

1. category
I want for each category: /section/category/
post should word still work with /section/title (no slash at the end)
Now only /section/?c= works.

2. tags
I’ve a section tag and the tagnames should be /tag/tagnames
Now only /tag?t= works.

3. trackback-url (not so important)
The plugins and hacks for trackback result a trackback-url like trackback.php?id=
For me: 404.
Could Your plugin solve this?

Thanks a lot for ideas and support! I’m also looking forward to some further examples.
Great plugin (for further discussion: no duplicate content and trailing slash-problem)

Offline

#65 2006-04-08 17:04:27

vesam
New Member
Registered: 2005-08-14
Posts: 4

Re: [archived] gbp_faux_static - uri forwarding.

Hi, and sorry to throw in such a trivial question but:
how do I point root (www.domain.com/) to an article?

I treid to use / or catch only / and nothing else around it with regexp but either did not get forwarding or managed to forward everything…

Thanks
Vesa

Offline

#66 2006-05-31 09:22:55

spiffin
Plugin Author
From: London, UK
Registered: 2004-06-08
Posts: 95
Website

Re: [archived] gbp_faux_static - uri forwarding.

I am only just beginning to get my head round the possibilities this offers.

Thank you for a wonderful plugin.

Offline

#67 2006-07-03 23:24:39

jag
Member
Registered: 2006-07-01
Posts: 10

Re: [archived] gbp_faux_static - uri forwarding.

Hi,

I’m new to textpattern and the plug-in system but when I activated it and without starting to use it I got this error message :

Warning: preg_match_all(): No ending delimiter ‘/’ found in /var/home/domain.com/www/textpattern/lib/txplib_misc.php(459) : eval()’d code on line 164

that comes up on all pages in testing mode I have the permalink mode set to section/title and the same error message appears when I use ?messy

I am also finding it really hard to understand how to set-up a forward from a section called :
/photos_professional
to
/photos/professional_photos.html

where both ‘photos_professional’ and ‘photos’ are sections but I just want it to look as if ‘professional_photos’ is an html page and is in the ‘photos’ folder.

I’ve looked through the examples but just can’t see an example that fits this. I have already done some mod_rewrite coding and I’m thinking it may be easier for me to just code it directly into the .htaccess file but in view of all the positive feedback you have I’m sure the problem of getting it to work lies with me.

Thanks,

John

Fixed
I got this to work by switching regular expressions off on a forward I had added that didn’t use regular expressions. Following the simplest route I put in URI: /photos/professional_photos.html and in permanent link format : /photos_professional and this works fine. Not very high tech and page specific but that’s what I wanted !

Last edited by jag (2006-07-03 23:58:19)

Offline

#68 2006-07-13 10:59:38

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

Re: [archived] gbp_faux_static - uri forwarding.

This plugin looks really nice but I don’t get it to work the way I like it.

The site I’m working on normally uses the URL scheme /section/title. For one single section (it’s called projects) I need URLs with /section/category/title to achieve the following:

  1. /section/category: A list of all articles in the section projects and – let’s say – the first category colloquium.
  2. /section/categroy/title: Same as above but showing only a single article.

If I follow the instructions that have been made in the postings above I always get a 404 error message in the first case and in the second case I get a list of all articles in my section and the respective category (that’s what I expected to get in the first case).

I’m using the following code in my page template:

<txp:if_category name="colloquium">
<txp:if_individual_article>
 <p>Woohoo :)</p>
<txp:else />
 <p>Just a list...</p>
</txp:if_individual_article>
</txp:if_category>

I never get this Woohoo thing…

I’m using TXP 4.0.3.

Nils

Last edited by Skubidu (2006-07-13 11:12:22)

Offline

#69 2006-07-13 11:07:25

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: [archived] gbp_faux_static - uri forwarding.

Skubidu, and everyone,

I’ve been neglecting this forum thread.. the reason for this is that I’m working on a replacement for this plugin. Which is going to be much improved and will offer more options and but yet be easier to use – hopefully…

Any advice I give now won’t be applicable in a couple of weeks, can you wait?

(If anyone wants to help me testing the new plugin send me a PM)

Offline

#70 2006-07-13 11:20:14

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [archived] gbp_faux_static - uri forwarding.

People seem to really like/need this plugin, but WOW, there sure are some documentation/user-end problems. How about I add this promising plugin to the plugin archives and people who figure things out (and different uses for the plugin) can help fill out the associated “Docs” page. K? Then everyone wins and poor Graeme doesn’t have to do everything himself. Give me a few minutes.

Offline

#71 2006-07-13 11:21:19

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [archived] gbp_faux_static - uri forwarding.

Whoops, Graeme beat me. New plugin you say? Well, I’ll hold off then. We’ll add th new one.

Offline

#72 2006-07-13 11:36:04

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [archived] gbp_faux_static - uri forwarding.

@Destry: Cant we archive this version as one of the older versions and also archive the new one as the latest version? This way we can maintain a subversion sorta thing. Please shed some light onto my half empty head:)

I’m going to help out with the plugin archive. I’ll have to go through the instructions properly before I start adding stuff.


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

Board footer

Powered by FluxBB