Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-05-10 17:54:52

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Can I do "this" with txp?

Bloke:

and pass their output to the address bar in a query string

Asked not enough in advance: How could they do so?

Last edited by uli (2008-05-10 17:58:01)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#14 2008-05-10 18:12:13

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

Re: Can I do "this" with txp?

uli wrote:

How could they do so?

In a classic HTML form with dropdowns, radio buttons etc, submit the results as a normal query via GET so they appear as:

site.com/index.php?sex=female&minage=22&maxage=28

I think you can do that?? (perhap code the form yourself in a page?) Then you could put this on the results page: <txp:article_custom section="models" form="filter" />

And in form ‘filter’ (untested):

<txp:smd_if field="urlvar:sex, urlvar:minage, urlvar:maxage" operator="eq, ge, le" value="?sex_cf, ?age_cf, ?age_cf">
  <txp:permlink><txp:title /></txp:permlink>
</txp:smd_if>

That would (should!) look at every article in the models section and test to see if the given sex in the custom field sex_cf matched the one given in the url variable sex from the relevent HTML form element. It also tests to see if the age custom field (age_cf) was greater than or equal to 22 and less than or equal to 28. If all those conditions matched, a link to the article’s title would be displayed.

I make no bones about the fact it might be slow with 300 articles (models) but it may work…

Last edited by Bloke (2008-05-10 18:15:40)


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

#15 2008-05-10 18:46:43

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Can I do "this" with txp?

My project probably won’t have as much articles (used bicycles), but thanks for warning me/us.
I probably might have figured out myself what I need, in order to get smd_if working, cause your help texts are really easy to understand, and you’re anticipating very much aspects the users of your plugins might stumble upon.

Bloke

I think you can do that??

Sorry, I’m a selfeducated carreer switcher. But if you name the objects I have to google for, then I will find them for sure.

Thanks, btw!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#16 2008-05-10 20:05:02

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Can I do "this" with txp?

Coming back to he basic problem that we are basically talking about a shop (or document management system) and not a blog or static website. Textpattern is no shop system and is missing some necessary core features for a shop CMS:

  • Boolean AND in search (not to mention other search logic statements)
  • Rights management for single articles (restricted access by user, country, etc.)
  • Core form editor (radio: i.e. male/female photo yes/no, checkbox: tags, checkbox: categories, checkbox: section, string: in fields, string: fulltext, date: diverse, …)
  • Search query report generator for lists, tables, article descriptions, etc.

IMHO many basic web shops – online and offline – offer those features above and offer some extra features which are not available in TXP:

  • Simple triggers (like ‘not available’ because of i.e. a model calendar feature – Did somebody say calendar?)
  • More complex triggers (like a ‘sold out’ sign in a shop)

There is a basic shop plug-in for TXP but I have never checked it.

I have done some pretty complex photo database projects for photo agencies with different software solutions and also from the very 1st line of code and all I know is that these advanced search features must be in the core code (or be saved as i.e. stored database procedures) because otherwise database performance is down pretty fast. I.e. check for actual availability and look into the rights management for every output item and do some more full text searches and you will see your PHP interpreter and the database engine going down the drain :)

Reminder: I love Textpattern for being a small solid CMS but reading the very 1st post of this thread reminds me of the fact that many people don’t design their data models right before they look for the right system for the output.

Last edited by merz1 (2008-05-10 20:13:01)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#17 2008-05-10 21:28:00

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

Re: Can I do "this" with txp?

uli wrote:

My project probably won’t have as much articles (used bicycles), but thanks for warning me/us.

Depends if you have a very large shop to store this many bikes :-)

if you name the objects I have to google for, then I will find them for sure.

Try looking for HTML form, select, radio, input (on w3schools.com?) and you’ll probably find what you’re looking for. I’ve never tried hard-coding an HTML form in TXP because all my forms have been of the ‘contact’ variety so zem_contact_reborn does the job. I can’t see any reason it wouldn’t work but having never tried it I couldn’t say for sure.

merz1 wrote:

Textpattern is no shop system and is missing some necessary core features for a shop CMS… many people don’t design their data models right before they look for the right system for the output.

Absolutely. Within the confines of TXP the best we can offer is up there in this thread. But whether it is the right tool for the job in this context is questionable. I suspect it can be made to do it but it won’t “feel” right to the site maintainer (and therefore probably the end-user). No tool can do it all and, for the reasons you state and more, TXP may well not be the right hammer for this particular nail.

I’ve said before that I have a photo site I’d love to get going but it would require a level of hacking and database mods that make me think twice. So I’ve shelved it for now until xpattern reaches the level of maturity at which I can treat photos like articles (or I find another tool in the meantime as elegant as TXP but with images as 1st class citizens).

There is a basic shop plug-in for TXP but I have never checked it.

It is very good and gets better every week. Trenc is doing an exceptional job bringing much-needed shopping ability to TXP in an easy to manage plugin.

Last edited by Bloke (2008-05-10 21:33:10)


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

#18 2008-05-11 00:49:48

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Can I do "this" with txp?

Bloke:

Depends if you have a very large shop to store this many bikes :-)

:) Clicked my way through the laughing stocks’ stock … More prose on credit card applications!

Bloke:

Try looking for HTML form, select, radio, input …

… and URL. Figured it out; after nibbling off superfluous form tags wrapped around each single group of inputs, everything worked as … umm … as everybody would have expected ;)

Last edited by Bloke (2011-02-17 21:04:21)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#19 2008-05-11 07:56:36

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

Re: Can I do "this" with txp?

…reading the very 1st post of this thread reminds me of the fact that many people don’t design their data models right before they look for the right system for the output

I think this is a key phrase – though to be fair to the poster, he or she is trying to ascertain this through their question. If this is for a small agency with a limited number of models and attributes (the 5-6 mentioned at the outset would seem to suggest that) targeted at a particular segment then it could be workable. If it will need to cater for 1000s of models (now or in the future) with multiple criteria and will be used by clients with very different model requirements then a dedicated solution would be better.

But then again, we don’t even know if the poster has read this thread…

BTW: Stef, thanks for smd_if ideas.
I agree a database query builder plug-in with GET-variable support would be fantastic.


TXP Builders – finely-crafted code, design and txp

Offline

#20 2008-05-11 12:56:58

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Can I do "this" with txp?

jakob wrote:

then a dedicated solution would be better.

Depends how you look at things. If you hire developer to do this, then it’s quite simple coz dev just works it out. In example s/he can expand Textpattern or s/he can just use something other CMS. One way is Symphony, but, probably, it’s good choise only for experienced dev, because as we know, Symphony doesn’t do anything without little programming knowledge. Althought it’s good choise for developer that likes work things out.

One way is to expand TXP. Some of those things can easily be done by non-professional, if he has good XHTML/CSS skills and big brainz. Most of things work fine with plugins, you just must remember to do not cause too many queries nor speed drop that could be the minus point of 10xmultiple plugins. To some cases you could need a real dev that could fit TXP to your needs aka build a custom plugin and at same time would tweaks things.

Yes, it can be done with TXP. Why? Because TXP easy after you get into it. Templating, theming, scripting and all sorts of things are easy to do, if we compare to something other CMS, in example to Joomla, that makes templating, the key thing, harder. But some stoned CMS could do, what your asking, right a way, with single key bush, but then the minus point is the customizing, layout, speed and how things work – stoned is stoned, customizing is killer.

Last edited by Gocom (2008-05-11 13:00:30)

Offline

#21 2008-05-11 13:46:09

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Can I do "this" with txp?

we don’t even know if the poster has read this thread…

But we are here and participating because of the fun of the question and not because of the fun for the poster. Enlightenment is just an option :)

Bloke: OK. Now you have stolen about two hours of my valuable time by forcing me to visit and read your website (still open in a tab). And Yes, I have read the TXPQ interview (part 1 +2). Nobody should click here.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#22 2009-11-22 16:38:49

wchung
Member
Registered: 2009-04-23
Posts: 29

Re: Can I do "this" with txp?

Does anyone know how to filter out articles that are older than a certain date? I am trying to display a random thumbnail of articles that were posted after a certain date. It seems this should be easy but I can’t find a tag that would do this.

Offline

#23 2009-11-22 19:00:33

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Can I do "this" with txp?

@wchung There is no direct feature with standard Textpattern tags to…

only post ‘something’ which is younger than date X.

Thinkable workarounds are too many to mention all possible.

You might check if <txp:article_custom /> used with arguments month="yyyy", limit="1" and sort="rand()" (random) is sufficent. (month="yyyy" might additionally be tuned with a fancy PHP date function for an automatic update of the current year)

If you need a headache – I suppose you are pretty new to Textpattern – check out the plug-in menagerie by bloke. They all start with smd_ … smd_if comes to my mind to solve your problem. Bloke will help… he loves complex solutions for ‘easy’ problems :)

But maybe I am totally wrong and there is a hidden feature somewhere. I never had that request so the above is all I have.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

Board footer

Powered by FluxBB