Jump to content

Where fill names


Андрей
 Share

Recommended Posts

Andrew,

That's obviously MODX syntax. Before I answer your question, I have two things to say:

1. Please, if you have a question, post in either the General Support  or the Getting Started or the API & Templates sections of these forums according the the relevance of the question.. This is the Tutorials Section of the Board where your posts/threads should be teaching something rather than asking questions, thanks. :)

2. Have you read this guide to PW for those familiar with MODX? If not, please do. It will answer questions such as above.

As you'll see from that guide, apart from the name of a page, all other fields on a page are custom fields. There is no default title, keywords, description, etc fields. You will have to create those fields and add them to your template. Then, create a page and make it use that template. If you want your keywords to be unique to each page, then do it this way (illustrated below). If you want your keywords to be the same across the whole site, then you can create a page that will act as a settings page. For now, I'am not going to go into details about such a setup but will let you explore the system more.

OK, so,

1. Create the following fields types

a. Name: keywords; Type: text or text area (depending on how much space you want)

b. Name: description; Type: text area

Make sure to give the fields labels and a "description" if you want to.

Your PW install should already come with the title field (if you installed the default PW profile)

2. Add the fields to your template. Order the fields in the template as you wish

3. Create a page and make it use the template in #2

4. You will see the keywords, description and title fields on that page. Enter your keywords and description in the fields and edit the page as you wish. Hit save.

5. In your template file

<meta name="keywords" content="<?php echo $page->keywords;?>"/>
<meta name="description" content="<?php echo $page->description;?>"/>
<meta name="robots" content="All"/>
<title><?php echo $page->title;?></title>

You don't need the <base> tag in ProcessWire.

You can get fancy and only echo out the keywords and description if they are actually present on your page. How to do that? That'll be your homework ;)

  • Like 3
Link to comment
Share on other sites

Ваш ответ поздно увидел,Спасибо!!! сам во всем разобрался CMS ^-^

Your answer has late seen,Thank you!!! itself in all understood CMS 

<!DOCTYPE html>
<html lang="en">
<head>
       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
       <title><?php echo $page->get("headline|title"); ?></title>
       <meta name="description" content="<?php echo $page->summary; ?>" />
       <meta name="keywords" content="<?php echo $page->keywords; ?>" />
       <meta name="robots" content="all" />
       <link rel="icon" href="/favicon.ico" type="image/x-icon" />
       <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
       <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates ?>styles/style.css?v=3"/>
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

×
×
  • Create New...