Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Splt my Head
Am trying to understand theme creation, so i decide to convert a static website to TXP.
I understand that i have to create:
Sections Pages Styles Forms
My head has meta & css link.Can i have some help how to convert them into sections?
<!doctype html>
<html class="no-js" lang="en-US">
<head>
<!-- DEFAULT META TAGS -->
<meta charset="utf-8">
<meta content="EnaDio" name="keywords" />
<!-- CSS -->
<link href="files/css/style.css" id="default-style-css" media="all" rel="stylesheet" type="text/css" />
<!-- FAVICON -->
<link href="images/favicon.png" rel="shortcut icon" />
<!-- DOCUMENT TITLE -->
<title>Study and design of corporate identity</title>
</meta>
</head>
EDIT: Use bc.. {space}
to create a code block (e.g. for your sample html code).
EDIT II: You can simply write in this forum without needing to insert html tags. If you want to add special formatting, just use textile notation.
Last edited by pagou (2016-07-05 10:52:41)
don’t shut, am just begin.
Offline
Re: Splt my Head
Yeia sou pagou,
Firstly, you do not need to use html in this forum as it is parsed with textile so it is automatically generated.
Can i have some help how to convert them into sections?
there is a sections tab under presentation>sections.
The idea is that you first create a page
under presentation>pages
That page will consist of html, txp tags, links to the css, js etc and you can even add your own php (if that is enclosed in the <txp:php> tag).
Once you finish the design, you go to presentation>sections where you create your section. You repeat this for your sections unless of course some sections use the same page. (page=template here)
This method of course creates a lot of duplicate code and that is where forms come in. Forms consist of txp tags and html (php, js, whatever).
For example you can have something like
<txp:article>
<div id="header"><h1><txp:title /></h1></div>
<div id="content"><txp:body /></div>
</txp:article>
After giving your form a name you can then call the above code in all the pages you need it to appear. This is done by using <txp:output_form form="name_of_form" />
.
There is a comprehensive listing of all the available tags on www.textpattern.net/wiki/index.php?title=Category:Tag_Reference
I hope that the above were of help. As your question was very general it is hard to give a direct answer but please do not hesitate to ask anything here as there are people ready to offer their advice.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Splt my Head
colak wrote #300149:
There is a comprehensive listing of all the available tags on www.textpattern.net/wiki/index.php?title=Category:Tag_Reference”:http://www.textpattern.net/wiki/index.php?title=Category:Tag_Reference
The old wiki is deprecated. Pleas start pointing new users to the new Textpattern user documentation, and to the new maintained Tags reference in relation.
Offline
Re: Splt my Head
if i had understand correct:
i had to create a form=TheHead, that will contain Css & Meta Tags.
Question 1) I cant understand where to save this tags.
Question 2) if this is my link,
{<link rel="stylesheet" id="default-style-css" href="files/css/style.css" type="text/css" media="all" />}
how should look my css tag?
don’t shut, am just begin.
Offline
Re: Splt my Head
Hi pagou,
Your css could be in an external file or it could be residing in the database which can be edited under presentation>styles.
If you use the second option the tag you should use is: <txp:css format="link" name="name_of_style" />
.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Splt my Head
ok, I did it.
1) i create a new style, under presentation>styles.
2) insert the link, give a name and save
——————
but, where i save the meta tags?
don’t shut, am just begin.
Offline
Re: Splt my Head
but, where i save the meta tags?
It depends on how you wish to handle the site. An easy way would be in presentation>pages.
pages for txp = to templates
Below is the way I use them in one of my sites (all residing in the default page/template). You could of course split them up and have different templates/section
<txp:section name=""><meta name="description" content="blah blah" /></txp:if_section>
<txp:if_individual_article>
<txp:article><txp:if_custom_field name="metad"><meta name="description" content="<txp:custom_field name="metad" escape="" />" /></txp:if_custom_field></txp:article>
</txp:if_individual_article>
<txp:if_section name="about">
<meta name="description" content="<txp:article_custom id="1"><txp:custom_field name="metad" /></txp:article_custom>" /></txp:if_section>
<txp:if_section name="nac">
<meta name="description" content="<txp:article_custom id="44"><txp:custom_field name="metad" /></txp:article_custom>" /></txp:if_section>
<txp:if_section name="workshops">
<meta name="description" content="<txp:article_custom id="2"><txp:custom_field name="metad" /></txp:article_custom>" /></txp:if_section>
<txp:if_section name="neme">
<meta name="description" content="blah blah" /></txp:if_section>
<txp:if_section name="related-links">
<meta name="description" content="blah blah" /></txp:if_section>
<txp:if_section name="events">
<meta name="description" content="blah blah" /></txp:if_section>
<txp:if_section name="participations">
<meta name="description" content="blah blah" /></txp:if_section>
<txp:if_section name="publications">
<meta name="description" content="blah blah" /></txp:if_section>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Splt my Head
but, where i save the meta tags?
I thought that I should add that the stable txp releases do not have a specific field for metadata so I used one of the custom fields which I named metad
but as from 4.6beta we do have them. The example above is use on txp version 4.5.7
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Splt my Head
pagou wrote #300199:
ok, I did it.
1) i create a new style, under presentation>styles.
2) insert the link, give a name and save——————
but, where i save the meta tags?
Here is the default page template I use on my personal site – which I adapted to Textpattern a number of years ago.
<txp:output_form form="start" />
<txp:output_form form="meta" />
<body>
<div id="outer">
<div id="upbg"></div>
<div id="inner">
<txp:output_form form="header" />
<div id="splash"></div>
<txp:output_form form="menu" />
<div id="primarycontent">
<!-- primary content start -->
<txp:article limit="6" />
<!-- primary content end -->
</div>
<txp:output_form form="sidebar" />
<txp:output_form form="footer" />
</div>
</div>
<txp:output_form form="finish" />
And meta contains:
<head>
<txp:output_form form="pagetitle" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Michael K. Pate's Home on the Web" />
<meta name="keywords" content="michael, keith, pate, michael pate, librarian, lifestream, social networks" />
[and a bunch more I removed to make this more readable]
<txp:if_section name="">
[meta tags I only need on the front page]
</txp:if_section>
<txp:output_form form="css compressed" />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<link rel="pavatar" href="http://michaelkpate.com/pavatar.png" />
<link rel="apple-touch-icon" href="http://michaelkpate.com/apple-touch-icon.png" />
<link rel="shortcut icon" href="http://michaelkpate.com/favicon.ico" type="image/x-icon" />
</head>
and pagetitle contains:
<txp:if_individual_article>
<title><txp:title /> :: <txp:site_name /></title>
<txp:else />
<txp:tru_tags_if_tag_search>
<title>Tagged with <txp:tru_tags_tag_parameter /> :: <txp:site_name /></title>
<txp:else />
<txp:if_section name="">
<title><txp:site_name /></title>
<txp:else />
<title><txp:section title="1" /> :: <txp:site_name /></title>
</txp:if_section>
</txp:tru_tags_if_tag_search>
</txp:if_individual_article>
Pretty much anything I am going to use on more than one template (or something really complex like the pagetitle logic) I prefer to put into a Miscellaneous Form.
Offline
Pages: 1