Jump to content

Specifying a Page Title (<title>) different from "Title" in Processwire


Christophe
 Share

Recommended Posts

Hello,

I'm just starting to learn Processwire.

If needed, I would like to be able to specify a Page Title (<title>) different from "Title" in Processwire.

For Headline, it is written:

Use this instead of the Title if a longer headline is needed than what you want to appear in navigation.

Often we also need a Page Title different from the menu link. Page Titles can be different/longer for SEO or other reasons, and menu links shorter for convenience for instance.

How can this be done and a "field" input be added to Processwire's Admin?

And/or the Page Title could use the Headline value (if it exists of course) instead of the "Title" value. This would be easier to implement I suppose. 

Thanks in advance

Link to comment
Share on other sites

You can add as many fields as you wish to any template. So you could create the following text fields, for example:

menu_title - for you menus

head_title - for you <title> tag

snippet_title - for a listing somewhere

main_title - for the actual page

And so on, and then just use them as you wish.

For instance, you could put <title><?=$page->head_title ?></title> in your head html.

I strongly suggest you do a couple of the tutorials on the wiki so that you understand a little more how it all works and then it will become clear:

http://wiki.processwire.com/index.php/Main_Page

Note: a couple of mine are getting a bit out of date, but they will still get you started.

Link to comment
Share on other sites

Thank you :).

I've just found that I had an answer after connecting to the forum again.
I didn't receive any notification in my email account, so I've come back here to check.

I wasn't (totally) sure if custom field "inputs" would be added to the administration area automatically.

I am starting with this tutorial: http://processwire.com/api/tutorials/development-getting-started/, also present in the wiki.

Link to comment
Share on other sites

......

I wasn't (totally) sure if custom field "inputs" would be added to the administration area automatically...

Except for name, all fields in ProcessWire Pages are custom fields :-). Yes, even Title is a custom field....Unless you specify a field as hidden, all fields added to a template will be available to all pages using that template....in the order you sorted them in the template. And here's a bonus for you....that doesn't mean that when you view that page (am talking frontend)...that you will see any fields automatically. Nada...you will have to output them yourself in your template file in the order you want, if you want! Sorry, I got carried away there for a minute...Enjoy!  O0

  • Like 3
Link to comment
Share on other sites

Hello,

I had read a bit about the custom fields in Processwire. Customizations/Customisations made easy :).

I am going to continue to look at the API documentation with Fields. I have read all that was before, except Hooks that can wait a little apparently.

I am also going to look at the wiki.

I should probably practice on a real project I guess.

I want to create my new website with the Foundation 4 profile (even if the third level of the top menu is on the left for "mobile" reasons I suppose, with arrows on the right). But I could do it with Bootstrap, Skeleton, or any other "framework". But, sometimes, the more choice we have the harder it is.

(I had used a bit Bootstrap on a Joomla! website and have also on a ImpressPages CMS website.)

I want to be able to create, in a few months, or less, something like here: http://www.espacepolygone.com/aep-2100.php and here: http://www.espacepolygone.com/entreprise/62/allianz-g-et-j-azais-assurances/.

With GPS coordinates also if possible (but perhaps it's enough on a map), a map (see what happens when we hover it. Not sure if it's a good idea), one or several images (I've seen in the forum that it could be a single static image or, if more, a lightbox "solution", for instance), one or more videos (optional), etc.

I want it to be mobile-friendly(, and "upgrade-friendly").

I will look at the demo website/profile also to learn more.

Thank you all :).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...