Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2012-04-05 23:13:42

thiago
New Member
Registered: 2012-04-05
Posts: 8

Re: Editing sections via the panel

Gil, Uli, thank you so much for taking your time to help!

I think I’m starting to get the hang of pages, sections and articles. Lol

Now when I put some text in “About” section, it created another “About”, which is under “About” section (site.com/about/about) – this is something I have to change in “default” template? Or is there a way to do that via the panel?

Thanks again guys.

Last edited by thiago (2012-04-05 23:14:22)

Offline

#17 2012-04-05 23:28:28

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 638
Website

Re: Editing sections via the panel

thiago wrote:

Now when I put some text in “About” section, it created another “About”, which is under “About” section (site.com/about/about) – this is something I have to change in “default” template? Or is there a way to do that via the panel?

The second “about” it’s the article title, like in WP it was the post title.
For example it can be example.com/about/my-cool-biography
so “about” it’s the section name, and “my-cool-biography” it’s the article title.

In your case when you got only one article assign to the section there is no need to view the article via it’s full url,
you can just view the section example.com/about

Offline

#18 2012-04-05 23:34:54

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

Re: Editing sections via the panel

The duplicate title display is caused by the way the default templates are coded. You can bend TXP, however, like pretzel dough once you get your head around it.

There’s min three ways to avoid the duplicate “About”, off the top of my head:
  1. Rename the article (whose title is the second “About”).
  2. Don’t link to the article, link to the section instead (You can test what I mean by clicking the section name in your nav). That way the article’s title is never displayed in the nav cause the article can’t be accessed (thus no resulting submenu entry).
  3. Edit the template: Presentation > Pages. Remove the following code from the sidebar-1 div:
<txp:article_custom  section='<txp:section />' wraptag="ul" break="li">
	<txp:if_article_id>&rsaquo;</txp:if_article_id>
	<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>

But be aware that with this deletion you’ll remove the submenus from the complete sidebar nav, for all pages.

Well, of course a fourth way: It’s probably smarter to put a conditional tag around the above:
<txp:if_section name="about"><txp:else /> above the code,
and below it the closing </txp:if_section>.
What this does: it simply doesn’t output anything in case the section visited is “About” (caused by having no content between the if_section condition and the txp:else tag), for all other sections it displays the article title sub menu.

And this time Gil was faster ;)


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

Offline

#19 2012-04-05 23:56:13

thiago
New Member
Registered: 2012-04-05
Posts: 8

Re: Editing sections via the panel

Can’t thank you enough guys! :)

Already got the difference between pages, sections & articles, lol. Now it’s time to have a little play around ;)

I’ll try to create a theme for a band’s website.. let’s see if I can do it! :)

Offline

#20 2012-04-06 00:14:14

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

Re: Editing sections via the panel

Another recommendation is the TXP tag reference pages where all tags, their attributes and possible values as well as default values are explained and code examples show how the tags are correctly applied and usefully combined.

Good luck with your website project!


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

Offline

#21 2012-04-09 07:55:01

thiago
New Member
Registered: 2012-04-05
Posts: 8

Re: Editing sections via the panel

Hey guys…

Is it possible to create custom theme options? Something like this in WP http://goo.gl/6AkLA

Offline

#22 2012-04-09 08:27:16

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,182
Website GitHub

Re: Editing sections via the panel

[ This should ideally be a separate thread topic ]

There’s no panel like there is in WP (AFAIK they’re all theme-specific anyway) but there are a number of different options you can explore:

Site-wide variables or text snippets

  • adi_variables, which stores a list of variables that you load at the beginning of your page template. You can then insert them in your page template where you need them with txp:variable or test for them with txp:if_variable. Variables are strictly text-only.
  • mck_snippets, which is a proprietary solution for storing chunks of text (formatted or not).

Per article options:

  • Custom fields. If you want a special kind of custom field, such as a check-box you might want to invest in glz_custom_fields.
  • Override forms as a means of displaying individual articles with a different layout or markup (example of its use).
  • Conditional tags in your page template that respond differently depending on what you fill out, e.g. <txp:if_excerpt><txp:excerpt /><txp:else /><txp:body /></txp:if_excerpt>. Use the same principle to test if a custom field is set.

Per author options:

  • smd_bio allows you to make additional fields per author (good for multi-author sites).

Last edited by jakob (2012-04-09 08:27:30)


TXP Builders – finely-crafted code, design and txp

Offline

#23 2012-04-10 10:56:51

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 638
Website

Re: Editing sections via the panel

A great plugin to customize the look of the write tab is bot_write_tab_customize
And another cool Stef’s plugin smd_tabber can be helpful.

But basically you can do it all using an article,
by creating a section and name it “Options”, then assign a new article to it with all the content
if for example it’s for changing the logo or header images, you can use the article-image field, if you want more images-fields and a better way to deal with them then use bot_image_upload plugin.
after that use article_custom to output that options-article content wherever you just want to in your pages/forms-codes.

If you are looking for a fast easy way without dealing with the Write-tab at all, then use smd_tabber to create a new tab, name it “Options”
in that tab page-code just drop links to where you want, so it will use like a fast easy navigation to edit stuff like specific – articles/images/files/links, and that’s all.

Offline

Board footer

Powered by FluxBB