1
ManXP
I have an idea
  • 2004/11/17 15:59

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


I am interested in SEO at the moment and i have an idea for my website. Now i need to know, is it possible to make that.

Ok, let's begin. My theme.html file has these lines:

meta name="description" content="xxx";
meta name="keywords" content="xxx";

I think you know why it's needed. But i want to have individual keywords for every page. So, if i will remove these lines from my theme.html and add keywords to each page personally, will it work? For example, on index.php i'll add one description and keywords, on article.php (News module) - another, and so on.
If it will work, when article.php will have keywords, they will be the same for all the articles, right? Because every story uses article.php as main file.

Any comments?

2
Mithrandir
Re: I have an idea

Alternatively, you could enhance the news module's article submit form with another textarea for inputting keywords, that are subsequently saved to the database.

When loading the article in article.php, you could then put
$xoopsTpl->assign('xoops_meta_keywords'$story->getKeywords());

or similar (will need implementation in the NewsStory class, naturally) - the assignment will then overwrite the keywords from the header.php with the article's keywords.

Only drawback is that it will not work if the articles are cached (but then again - caching individual articles causes problems anyway due to the admin-only buttons etc.)

3
ManXP
Re: I have an idea
  • 2004/11/17 16:14

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


Thanks you for an answer. But if articles are not cached, still can i remove keywords, title, description from theme.html and add all these lines on every *.php file individually?

I know, it will take some time to do this, but i am ready if it works

4
studioC
Re: I have an idea
  • 2004/11/17 16:27

  • studioC

  • Friend of XOOPS

  • Posts: 922

  • Since: 2003/12/7


hi there ..

Quote:
So, if i will remove these lines from my theme.html and add keywords to each page personally, will it work?



no, not really this way. you know that all pages are rendered through theme.html and that the metatags of an html document belong in the head tags of yor theme html.

idex.php's of modules are displayed within smarty expression <{$xoops_content}> which means mostly in the center of the body of the theme.html



you may assign your own content smartys or use existing smarty to display it in theme.html if modul is active. you can add or replace <{your_metasmarty}> with normal <$xoops_meta>}> ... i've seen such solutions and some who give some meta tags with the use of xoops_modulheader to head of theme.html but dunno really where ... perhaps some modul devs can give a hint on his ..


cheers and have fun ...
michael

5
ManXP
Re: I have an idea
  • 2004/11/18 10:28

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


Ok, i did it but got some problems. I started with News module. Edited all template files and inserted individual titles, descriptions and keywords. Wokrs nice with News Index, Archives and Articles. But i don't see a title when submiting news, editing a story or posting a comment (just web address instead of title).
So i edited submit.php and inserted in the top of php code:

<html>
<head>
<title>xxx</title>
</head>
<body>
Original PHP code not modified at all...
</body>
</html>

And what i got? A crap in submit page. I mean all the text is displayed (title too), but menus and other elements are looks scary. What i did wrong?

6
ManXP
Re: I have an idea
  • 2004/11/18 10:30

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


Quote:

studioC wrote:
hi there ..
idex.php's of modules are displayed within smarty expression <{$xoops_content}> which means mostly in the center of the body of the theme.html



you may assign your own content smartys or use existing smarty to display it in theme.html if modul is active. you can add or replace <{your_metasmarty}> with normal <$xoops_meta>}> ... i've seen such solutions and some who give some meta tags with the use of xoops_modulheader to head of theme.html but dunno really where ... perhaps some modul devs can give a hint on his ..


Could you explain a little more, please?

7
ManXP
Re: I have an idea
  • 2004/11/18 14:13

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


Quote:

<html>
<head>
<title>xxx</title>
</head>
<body>
Original PHP code not modified at all...
</body>
</html>

And what i got? A crap in submit page. I mean all the text is displayed (title too), but menus and other elements are looks scary. What i did wrong?


Ok, i solved this problem already, now every page has it's own title, description and keywords.

Just small issue - because i removed all titles from theme.html, now uniqu titles appears on website too slow. I mean, that when user clicks on any link, he see just an daddress first, and title appears after this.

You can go athttp://www.soft-news.net and click on any link (RSS Feeds, Contact Us, etc) for an example. What can i do to load the title immediately?

Thank you all for your responses

8
studioC
Re: I have an idea
  • 2004/11/18 16:12

  • studioC

  • Friend of XOOPS

  • Posts: 922

  • Since: 2003/12/7


hi again,

if you do want to edit your module-index.php manually it's perhaps
easier to assign a smarty within your index.php of module like ..
...
$xoopsTpl->assign('mymodule_meta_keywords''featured news of ports in
your town, dunno really what to fill in'
);
$xoopsTpl->assign('mymodule_meta_description''description of each
module header'
);

and use in theme.html
<head>
...
<
meta name="keywords" content="<{$mymodule_meta_keywords}>,
<
{$xoops_meta_keywords}>" />
<
meta name="description" content="<{$mymodule_meta_description}>,
<
{$xoops_meta_description}>" />
..
</
head>

smarty will be unique cause theres normally just one module each page.
if there's no smarty found during parsing the theme it will only display

<{$xoops_meta_keywords}> and <{$xoops_meta_description}>


beat me if i am wrong or teach me?

cheers
michael

9
ManXP
Re: I have an idea
  • 2004/11/18 17:11

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


What a great idea. Fast and easy way to customize each module. Thank you very much :)

10
ManXP
Re: I have an idea
  • 2004/11/22 11:12

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


Hm, still have a little issue :) This method works in all the modules, but it doesn't work in search.php (in root direcotory). Why?
When i add these lines, title doesn't work, keywords and description don't work too. Any ideas? Thank you.

Login

Who's Online

161 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 161


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits