Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2009-08-07 05:35:07

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Improvements to Content Control

One issue of adding content through forms (or page templates) or variables or whatever is losing the possibility to search that particular content.
Of course, sometimes they are just small chunks of content, with not too much real value… so having them out of the search isn’t a matter.

On the other hand, a custom_field approach like the one suggested by hakjoon is a possible solution, although again, that particular article becomes searchable, and then it may appear in search results (i’m talking about results using the TXP search). Then, the URL could be exposed…

In this sense, the “sticky” approach may be still the best solution. A combination of sticky + custom_field may be even better, as the custom field will let you choose which sticky article is the chosen one for section front page.
Finally, directly using (on page template for a section) txp:article_custom id="xx" attribute is also a good choice to simplify all the jugglery with conditionals and/or custom_fields and/or status.

Again, an status (hidden…) that let you use an article on article lists (section context) but not on individual article context (permalink returning 404, or anything else) would be really useful.

I never took time to figure out gpb_permanent_links, but this is pretty interesting.

Playing once again with it on a rather complex project… I’m about to give up… This plugin seems to work very erratically each time I try to use it. It’s indomitable.
Graeme is working on a new version from scratch… since long time ago
I think I’m ready to try to fund further development, so I think I’ll drop Graeme a line…


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#26 2009-08-07 14:21:31

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Improvements to Content Control

There are definitely times when sticky would be the right approach. Using the custom field lets you choose (like you said). I didn’t have to really deal with search the times I’ve used this so I haven’t had to solve that problem. I did want to implement dynamic navigation for the each article in a section (which I think sticky status complicated) and wanted to suppress the url’s for section home page so I ended up doing something like this using article_custom

<txp:if_custom_field name="Section_Home_Page" val="Yes">
	<txp:section link="1">
		<txp:output_form form="menu-text" />
	</txp:section>
      <txp:else />
	<txp:permlink>
		<txp:output_form form="menu-text" />
	</txp:permlink>
	</txp:if_custom_field>

I wonder if you could somehow massage the permlink in search results in a similar fashion.

At this point the main hurdle for me was explaining all the steps in the TXP interface to create a new area since you have to jump from section back to write. Having a slightly modified admin interface geared to this workflow where one could pick “parent” pages to assign pages too might be simpler.

That would strictly an UI thing though since the underlying functionality is mostly there. I haven’t had a chance to look at what’s possible with themes in 4.2, but I always thought that being able to slightly change the ui workflow for specific implementations would be a huge feature, since the underlying infrastructure is so flexible already.


Shoving is the answer – pusher robot

Offline

#27 2009-08-07 14:44:55

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

Re: Improvements to Content Control

Don’t forget the power of the cononical rel attribute, as jakob pointed out. From my rudimentary understanding: even if the URL is ‘exposed’ in search results, when a spider actually visits that page and finds rel="canonical" it’ll index the preferred form. Thus:

<txp:if_article_section name="about, contact, other-one-page-section">
   <link rel="canonical" href="/<txp:section />" />
</txp:if_article_section>

(untested, just a guess).

Combined with some of the other techniques outlined in this thread it should be one more trick to at least help avoid ‘duplicate’ content.

I too really like the way adi_variables allows you to use stuff in pages. I’m sure a more general-purpose plugin could achieve what driz is after… and if it could be injected in the way hakjoon suggested using the pluggable_ui() feature of 4.2.0, the workflow is altered directly on the Write tab. Nice!

Last edited by Bloke (2009-08-07 14:46:36)


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

#28 2009-08-10 19:59:19

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Improvements to Content Control

I think the best solution so far is to be able to post to a fake section. From what I can gather in WordPress pages and posts are the same, except they are rendered differently on the front and the pages can choose a custom template if the user wants. So the same in TXP would be getting an article to render either as an article as part of a section like a blog post etc, or standalone and therefore more like static content. The problem is how to control this, we would need two options one to say what whether the article is standalone (perhaps this could be chosen in the section dropdown), and then an option to choose what page template to use for that article as that article will now be acting as section as well and wont have a page template choses already.

Thoughts? I personally see this as the winning solution, and it makes sense to both TXP semantics and the general user who understands none of it.


~ Cameron

Offline

#29 2009-08-10 22:34:04

Neko
Member
Registered: 2004-03-18
Posts: 458

Re: Improvements to Content Control

driz wrote:

@Neko Thanks :D What was it that I suggested that was so bad?

Sorry, nothing really. I was just kidding. :)

Offline

#30 2009-08-10 23:22:49

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Improvements to Content Control

Perhaps content-types like you get in Drupal could also be something to think about as well? But the problem occurs because of the TXP semantic model of HAVING to choose a section for it whether it needs one or not.


~ Cameron

Offline

#31 2009-08-10 23:32:16

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Improvements to Content Control

Content types have come up before. I think I would be a great addition to TXP and not that hard to implement (DB wise). It would be a breaking change though so it would have to happen at some point where breaking backwards compatibility would be ok.

That being said section based url schemes like you can do with gbp_permanent_links would get you pretty far some ui changes to make “pages” automatically go to that section and maybe use override form as template chooser and you get pretty close.

Then of course you have to hide pages from the article list and hide teh pages section in teh article write tab and you start going down wanting to have content-types again :)

Last edited by hakjoon (2009-08-10 23:32:32)


Shoving is the answer – pusher robot

Offline

#32 2009-08-11 00:00:09

PascalL
Member
From: Switzerland
Registered: 2009-03-09
Posts: 132
Website

Re: Improvements to Content Control

I’m not sure I understand all the solutions posted here, and maybe I miss some points, so please tell me if I’m totally off.

As said before, Wordpress static pages are not much different from standard article. The real difference is the hierarchical navigation menu to access them. I think we can (nearly) do the same in Textpattern.

Please note that Wordpress pages are never mixed with articles, except with some plugins. We just need one section, let’s call it “pages”, and every static article will land there. We can easily exclude this section from all the other article listings. Default form should be fine.

Now we need to know “who” is the parent of the pages down the tree. For this we use a custom field named “parent”. Leave the field empty for root pages, and enter the URL-title for the others. I didn’t manage to make it work with the standard title, maybe because of spaces in nested tags. The URL-title should still be easy enough: “my-trip-around-the-world” instead of “My trip around the world”. Use of article ID is possible, but not very user friendly IMHO!

I didn’t bother ordering the pages for the moment, but we could do it with a custom field as well and give a rank, just like Wordpress does.

Now, in the sidebar we call the “static” menu:

<h4>Pages</h4>
<txp:article_custom section="static" parent="" form="static_article_list" break="li" wraptag="ul" />

and here is the static_article_list form which is a bit recursive-like:

<txp:permlink><txp:title /></txp:permlink>

  <txp:variable name="parent_name" value='<txp:article_url_title />' />
  <txp:article_custom section="static" parent='<txp:variable name="parent_name" />' break="li" wraptag="ul">
    <txp:permlink><txp:title /></txp:permlink>

    <txp:variable name="parent_name" value='<txp:article_url_title />' />
    <txp:article_custom section="static" parent='<txp:variable name="parent_name" />' break="li" wraptag="ul">
        <txp:permlink><txp:title /></txp:permlink>

        <!--insert more levels here-->

     </txp:article_custom>

  </txp:article_custom>

This form outputs three nested levels, this should be enough for most cases, but you can easily insert more levels.

As I suspected, true recursion, like call a form from inside himself, is not possible. But I think the code is quite straighforfard, thanks to the powerful txp:variable tag, and the uber-powerful tag nesting capability!!!

Now, this is just a start, I didn’t really look at the question of URLs, or the cost in term of queries needed just for static pages. And I’m sure I’ve overlooked other potential problems.

Offline

#33 2009-08-11 01:06:27

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Improvements to Content Control

Yeah but using variables/custom fields for this is totally a hack! Custom Fields should be used for additional article data, not for constructing stuff like this. The proposed system needs be very lightweight and easy to use for a potential idiot client who knows nothing of TXP semantics and not rely on complex templates in the backstage areas.

Content Types do sound like an awesome idea, but they need to addressed properly, if they become overly complex then it will break the minimalist approach that we are all used to with Textpattern. Perhaps Sections and Categories also need to be re-thought as they will play a major role in any changes to the core when dealing with such large changes! (Perhaps even sub-sections should be though about being finally added while we’re at it) I mean what do sections really offer? why would categories not be sufficient like in WordPress? Perhaps these need to be thought about so that it becomes really clear as to what they offer and how they can allow perfect control over various content types whilst still keeping the traditional TXP model in place.

Last edited by driz (2009-08-11 01:11:46)


~ Cameron

Offline

#34 2009-08-11 01:22:27

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Improvements to Content Control

Cameron….nnnnoooooooooo!!!!!!

Bloody hell mate…don’t mention sub-sections.
This thread was going along so well…now it will get all polluted.

Just kidding. I’d love to see sub-sections – but stick to one battle at a time.

While I’m here: I must say that I’m impressed with many of the ideas here – and the improved attitude in your posts.

:)

Last edited by renobird (2009-08-11 01:23:34)

Offline

#35 2009-08-11 01:49:50

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Improvements to Content Control

I know I keep comparing things to WordPress but it has a good way of dealing with content from an idiot perspective and it also works quite well too however it relies on theme-dependancy where as TXP doesn’t have themes (this is why themes are a bad idea!)

But here is the problem in detail:

In WP you have a page, this page can contain text etc and then you either use the basic template or a custom one.
In TXP we create a section and then we can have any page template we like.

The problem here is that we haven’t created any content using the TXP method, we need to create an article as well, now this is a good thing because sections are not content but content dividers, but its also harder to grasp from a user view as in WP its just post your pages and organize, in TXP you have to create the section followed by the content but then the content needs tweaking (making stickie at the moment) for it to work. So this is clearly inefficient and also complicated in comparison to the WordPress method.

So the proposal, sections need redesigning so that they are a simple table in rows where the user can create nested schemes and so to create a site structure. Next we need content types to determine what kind of content we have available. We should probably have defaults here “Posts” “Pages” and then the user just has a simple write box and they can choose the section and the content type.

Example:

section is about and article is called about me and then content type is posts the url will be
domain.com/about/about-me

if the latter is the same but using pages as the content type then the url will be
domain.com/about/

This takes ideas from both WordPress and Drupal but keeps the Textpattern semantic model intact but much more powerful and easy to use.


~ Cameron

Offline

#36 2009-08-11 01:58:15

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Improvements to Content Control

One thought about rethinking sections and categories.

I do think sections offer something different from categories in that they are presentational groupings not organizato groupings (at least in TXP’s original design descriptions). However this gets mixed up because sections define the url location of the content, so they in essence become organizational.

One thing that could be done is to move all organization to categories and assign categories to sections for their presentation. So sections get removed from the url, but when items in category X are retrieved we know it belongs in section Y and we apply the appropriate page. This actually removes the presentation aspect even more from the client who should really be thinking of where things belong.

EZ-publish does this and it works. Again though this breaks current behavior so it needs to be thought about with care. But we already have parent/child category relationships so it would give us something akin to sub-sections.


Shoving is the answer – pusher robot

Offline

Board footer

Powered by FluxBB