Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-06-11 10:51:27

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Best approach: Banner images? Exclude from feed?

Hi,

I have one entry that I will be using to manage banner images which will show up on main index page… I do not want this “entry” to show-up in the XML feed.

What is best way to setup a page like this in terms of category and/or sections?

Just curious to hear what the experienced folks suggest. :)

My current approach is to this:

On default template page: <txp:article_custom form="banner" category="banner" section="no-xml" limit="1" />

Where section “no-xml” has these settings:

Uses Page: Default
Uses Style: Default
Selected by default: no
On front page: yes
Syndicate: no
Include in site search: no

Does that seem like a good approach? It seems to work, but is it “best practice”?

Many TIA!
Cheers,
M

Offline

#2 2007-06-11 11:39:34

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Best approach: Banner images? Exclude from feed?

This largely depends on your requirements: Do you need most of an article’s properties as

  • publish date
  • Textile
  • categories
  • ping
  • form overrides
  • etc…

If you don’t, use a form.

Last edited by wet (2007-06-11 11:40:05)

Offline

#3 2007-06-11 19:14:48

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: Best approach: Banner images? Exclude from feed?

Hi wet, thanks for the help. I really appreciate it and I owe you another! :D

All I need is an easy way for my client to edit a custom field in order to control the ordering of several image ID’s:

Custom Field Name: Images
Value: 2, 7, 9, 3, 5

And that is it.

The easiest way I could think of for my client to do this (via txp) was by using a single article entry.

So, it sounds like I may be going overboard with a new section and such? I think my client prefers simple and easy.

Thanks a million wet, I greatly appreciate the help. :)

Have a great day/night,
Cheers,
Micky

Offline

#4 2007-06-12 05:21:56

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: Best approach: Banner images? Exclude from feed?

wet wrote:

If you don’t, use a form.

Actually, would it be too much trouble for me to ask you what you mean by this?

I am pretty sure I understand… Do you mean use a form like so:

<txp:article_custom form="banner" category="banner" section="no-xml" limit="1" />

Also, I assume hidden entries will not show up in xml, so I could delete the special “no-xml” section and just give the above entry a status of hidden, and display it like so:

<txp:article_custom form="banner" category="banner" status="hidden" limit="1" />

Either way, is that what you mean by use a form?

Sorry if I am being dense. :)

Thanks again Wet!
Cheers,
M

Last edited by mhulse (2007-06-12 05:28:36)

Offline

#5 2007-06-12 08:15:18

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Best approach: Banner images? Exclude from feed?

mhulse wrote:

Either way, is that what you mean by use a form?

A misc form, as it is editable on the “Presentation > Forms” tabs, can contain any HTML markup, plus textpattern tags. You can display it anywhere on a page template or inside an article with txp:output_form. Read more here. Think of forms as small building blocks you can assemble the rather static parts of a page with.

But as you require a custom field, you’ll have to use an article anyway.

Offline

#6 2007-06-12 10:52:44

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: Best approach: Banner images? Exclude from feed?

Ahhh, I see. I have not really explored the different form types… just article forms. Thanks for the clarification, I really appreciate it. :)

Many many thanks Robert. Have a great day/night.

Cheers,
M

Offline

#7 2007-06-13 12:14:33

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: Best approach: Banner images? Exclude from feed?

Hooo boy! Thanks again Robert! I optimized/modularized my template… Muuuuuch better:

<txp:output_form form=“includes” />
<txp:output_form form=“dtd” />
<head>
<title><txp:page_title /></title>
<txp:output_form form=“meta” />
<txp:output_form form=“js” />
<script type=“text/javascript”> <!— /* Inline JS */ //—>
</script>
<txp:output_form form=“css” />
<style type=“text/css” media=“all”> <!— /* Inline CSS */ —>
</style>
<txp:output_form form=“xml” />
</head>
<body>
<txp:output_form form=“top” /> <txp:article_custom form=“banner” category=“settings” status=“hidden” limit=“1” /> <div id=“accordion”> <txp:article_custom form=“category” category=“settings” status=“hidden” limit=“1” /> </div>
<txp:output_form form=“bottom” />
</body>
</html>

Thanks again for the tip!

Cheers,
Micky

Offline

#8 2007-06-13 12:16:03

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Best approach: Banner images? Exclude from feed?

You’re welcome!

Offline

Board footer

Powered by FluxBB