Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags for novices


GemRock

Recommended Posts

This is the support thread for the Header Tags For Novices Contribution, which can be found:

 

http://www.oscommerce.com/community/contributions,4822

Edited by GemRock

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

This is the support thread for the Header Tags For Novices Contribution, which can be found:

 

http://www.oscommerce.com/community/contributions,4822

 

I just had to try this contrib, it would be very handy for a noob customer..

 

All works fine after installation and a first test looks like it runs perfect.

After a second test it went wrong, a update click puts me on somebody else his website.

 

I think the server adres / domain / local adress line is missing ??

Link to comment
Share on other sites

Hi Evert

 

Thank you for your feedback.

 

I dont understand why you experienced that problem. Maybe you could try to add a base href line between the <head> & </head> in the file header_tags_edit.php under the admin folder, to see if the problem goes away? I think this could well be an isolated issue which only happens to your osc setup, because I have tested it on different servers/sites and never come across this problem, and as far as I can see, none of the files under the admin folder has that base url line in the header tag.

 

Ken

 

I just had to try this contrib, it would be very handy for a noob customer..

 

All works fine after installation and a first test looks like it runs perfect.

After a second test it went wrong, a update click puts me on somebody else his website.

 

 

I think the server adres / domain / local adress line is missing ??

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

For those who dont mind to spend a few more minutes on installation of this contrib, you can make the header_tags_edit.php accessible from the catalog box:

 

1. open filenames.php under admin/includes/

 

add this line just before the closing ?> at the bottom of the file:

 

 define('FILENAME_HEADER_TAGS_EDIT', 'header_tags_edit.php');

 

Save & close the file.

 

2. open english.php (or your shop's language.php) under admin/includes/languages/

 

find this line:

 

 define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Products Expected');

 

Below it, add:

 

 define('BOX_CATALOG_HEADER_TAGS_EDIT', 'Edit Header Tags');

 

Save & close the file.

 

3. open catalog.php under admin/includes/boxes/

 

find this line:

 

 $contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .

 

below it, add:

 

'<a href="' . tep_href_link(FILENAME_HEADER_TAGS_EDIT, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_HEADER_TAGS_EDIT . '</a><br>' .

 

Save & close the file.

 

Now, you can access the Edit Header Tag function from the catalog box.

 

Enjoy!

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

...I think the server adres / domain / local adress line is missing ??

No is the my answer after some investigation into your reported problem. The code behind the Update button in the header_tags_edit.php is this:

<form name="update" method="POST" action="<?php echo "$PHP_SELF?action=update&page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer"; ?>">

where the $PHP_SELF variable is defined in application_top.php (the one on the admin side):

$PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);

You can check the 'PHP_SELF' param from the server info link under admin - Tools - Server Info, where you can find the path to 'PHP_SELF' under the PHP Variables section, and the path to 'SCRIPT_NAME' under the Environment section. Make sure they are not pointed to any where outside your site. I know this may be a bit of over the top for a noob, but I suppose you could raise the issue with your host.

Other than that I cant think of any reason why it's happen, and I can not re-produce the problem.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Hi, ive just installed this, everything is working sweet for the products, thanks loads!! However there are a couple of minor issues i think need addressing:

 

1) On my index page, no tags are generated, this is the "view source" output:

 

<meta name="description" content="">

<meta name="keywords" content="">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

 

Not sure why it does this, im a newbie?

 

2) When using the header_tags_edit.php page i get the following error if i try and browse any other page than the one it opens with!

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

select count(*) as total from products p, products_description pd where p.products_id = pd.products_id and pd.language_id = '1'order by

 

[TEP STOP]

 

 

 

Thanks for the contribution, look forward to your reply!

Link to comment
Share on other sites

Hi squiffythewombat

 

Thank you for your feedback!

 

For your question 1, in your index.php, replace the two meta tags with:

<meta name="description" content="<?php echo (strlen($categories['categories_name']) > 1) || (strlen($manufacturers['manufacturers_name']) > 1) ? strip_tags($breadcrumb_tags->trail_tags(' ')) : 'default description'; ?>">
<meta name="keywords" content="<?php echo (strlen($categories['categories_name']) > 1) || (strlen($manufacturers['manufacturers_name']) > 1) ? strip_tags($breadcrumb_tags->trail_tags(' ')) : 'default keywords'; ?>">

Replace 'dafault description' and 'default keywords' with your choosen description & keywords for your home page.

 

For question 2, it seems from your post that the error was not from header_tags_edit.php? If not, then could you please explain a bit more details what exactly you did step by step that led to the error, as I could not recognise there's such a query in the header_tags_edit.php. Maybe it's an error which has already been in your admin panel before you install this contrib?

 

Ken

Edited by GemRock

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

This is the support thread for the Header Tags For Novices Contribution, which can be found:

 

http://www.oscommerce.com/community/contributions,4822

 

 

Hi Ken, I added and changed the code and can see the choice to edit Header tags on my catalog page, but when I click it I get this error, "The requested URL /store/admin/header_tags_edit.php does not exist." Did I miss something? Thanks, Heather

Link to comment
Share on other sites

...when I click it I get this error, "The requested URL /store/admin/header_tags_edit.php does not exist." Did I miss something?

Well, this is a easy & quite straightforward one:

1. if you have followed the instruction as in my post in this support thread, then in the catalog box, just under Categories/products, you'd see Edit Header Tags. While moving your mouse over to that link, look at your browser's status bar at the bottom. If you see (your-store-url)admin/header_tags_edit.php (all lower cases for the file name), then your installation is indeed correct. Otherwise you may be missing one or two steps.

2. if you've verified that 1 above is correct, then the only possible cause for the problem is the file in question is not there, as yet. From the download, look for the file hearder_tags_edit.php under the admin folder, and upload it to your site, again, under the admin folder.

 

I was thinking by the time I posted my reply, you may have solved the problem yourself. :)

 

Good Luck!

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

A new package has beed uploaded to the contribution server, to include the two missing png image files :blush: . No other change.

 

Ken

Edited by GemRock

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

First of all Great contrib!!!!

 

Second.

 

I´m not a very well educated programer or so but I´ve managed to set up a oscommerce shop so far.

 

My problem is now that when I go to http://www.yoursite.com/your-admin-folder/...r_tags_edit.php (ofcourse I go to the right one... :)

 

I do get this error at the bottom under the insert fields.

 

PHP Notice: Use of undefined constant FILENAME_HEADER_TAGS_EDIT - assumed 'FILENAME_HEADER_TAGS_EDIT' in C:\Webs\LocalUser\yoursite.com\catalog\admin\header_tags_edit.php on line 14

 

Line 14 in header_tags_edit.php says:

 define(FILENAME_HEADER_TAGS_EDIT, 'header_tags_edit.php');

 

any sugestions are all very welcome!!!

 

Thanx in advance!

 

//Talle

Link to comment
Share on other sites

Oh I forgot,

 

I do not know if it makes a diffrence but I´ve also added the file header_tags_edit.php to my swedish language folder and translated the text for it, it shows up perfect in swedish but I do not know if this has any impact on my error above...

 

Thx

 

//Talle

Link to comment
Share on other sites

Hi Talle:

 

Thank you for your comment! Sorry for the problem you experienced.

Well, I dont know exactly what caused it since I tested it just after I read your post, switching between php 4 & php 5 just in case, but I didn't see any error.

I think you could try to add single quote the 'FILENAME_HEADER_TAGS_EDIT' as it normally would, like:

define('FILENAME_HEADER_TAGS_EDIT', 'header_tags_edit.php');

It works for me without the quotes (by accident I forgot the quotes but as it worked so I leaved it what it was).

Or you could try to delete that line and follow the instructions a few posts above to make it accessible from the catalog box.

Yes you can use it in any other language if you translate th elanguage file into your language, which is on ethe thing I'd have mentioned but thought people were smart enough to know thist :) , but I dont think this would cause that error.

 

HTH

 

Ken

Edited by GemRock

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

I do admire your skills!!!

 

Adding the quotes sorted me out just fine! *bowing and lifting my hat!!!*

 

By the way, I´ve made the addons above to make it accesible from the admin page.

Everything is now working fine and smooth.

 

But as do like easy ways, I have to say that I miss a button in the edit page to go back to the admin page...

It works fine to use the "Administration" link in the top left corner but that takes me out to the blue startpage, I´d like to go back to say catalog....

 

This is not a major problem but more of a cosmetic one... :blush:

 

Anyhow!

 

Thank you very much for a great contrib and fast support!!

 

Best regards!

 

//Talle

Edited by wheeloftime
Link to comment
Share on other sites

...I miss a button in the edit page to go back to the admin page...

Hi Talle

 

Thanks. You make a good suggestion. Here is how you can get it:

 

Open header_tags_edit.php, look for the this (at about line 244):

echo tep_image_submit('button_update.gif', IMAGE_UPDATE) . '  ';
	echo '<a href="' . tep_href_link(FILENAME_HEADER_TAGS_EDIT,"row_by_page=$row_by_page") . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

Insert this line just above it and below the <?php

echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>  ';

Save the file and that's it. Now, next to the Update button, there will be the Back button, which will take you back to the catalog page. Be careful though don't click Back when you mean to click Update! :blink:

 

Enjoy!

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Guys i installed the contribution works grate real grate!

But i do have one small problem,

how can i change the index header?

i still have E-commerce shown up in my title at my index page...

How can i change that a little help please

Link to comment
Share on other sites

Hi yos40:

 

The default title is defined in catalog/includes/languages/english.php: (assuming you are using English)

 

define('TITLE', STORE_NAME);

The STORE_NAME is defined in admin -> Configuration -> My Store - Store Name

 

So, take a look at the two places to see if you can change it, and let me know.

 

HTH

Ken

Edited by GemRock

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Further to my post above, you could ignore the store name in the admin - configuration, and change it in the above-mentioned english.php:

define('TITLE', 'Type in the Title you want here');

Of course, you could use my contribution to define the title for different pages.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

hmmm another question, again...

 

I do not know if this is related to this subject, if not please remove my post and take my appologies!

 

In my blue top frame in IE i get good names almost.

As it displays my categories first it look like this:

<u><b>category</u></b> Subcategory - mydomain.se - Windows internet explorer

 

you can see for yourself here. http://www.babies.se/index.php?cPath=30_33

 

I do know that I have made the

<u><b></u></b>

I´d like to remove these from the top of the page, but these are as far as I know nessecery to get bold font in the categories... or am I wrong?

 

Thanks again!

 

//Fredrik

aka

Talle

Edited by Talle
Link to comment
Share on other sites

Hi yos40:

 

The default title is defined in catalog/includes/languages/english.php: (assuming you are using English)

 

define('TITLE', STORE_NAME);

The STORE_NAME is defined in admin -> Configuration -> My Store - Store Name

 

So, take a look at the two places to see if you can change it, and let me know.

 

HTH

Ken

 

Thanks allot works Grate your contribution is amazing I'v been trying for weeks to install all kind of cont and i allways get errors i guess becouse its a ready tamplet and not the original oscommerce one!

What do you mean by using your contrib to controll other pages? all i see in the header_tags_edit.php page is the products i have and not even one option to change indvidual pages titles by themself...

 

Plus i was meaning to ask you, is there a way that the product name will show up first and than the catagory? (i mean in the title bar) as you know google allwayes consider the first few words as his main indexing words and the rest of the words a an guiding words...

 

Thanks so much for everthing for the time and thoght you devoted to this contribution

Link to comment
Share on other sites

Well, this is a easy & quite straightforward one:

1. if you have followed the instruction as in my post in this support thread, then in the catalog box, just under Categories/products, you'd see Edit Header Tags. While moving your mouse over to that link, look at your browser's status bar at the bottom. If you see (your-store-url)admin/header_tags_edit.php (all lower cases for the file name), then your installation is indeed correct. Otherwise you may be missing one or two steps.

2. if you've verified that 1 above is correct, then the only possible cause for the problem is the file in question is not there, as yet. From the download, look for the file hearder_tags_edit.php under the admin folder, and upload it to your site, again, under the admin folder.

 

I was thinking by the time I posted my reply, you may have solved the problem yourself. :)

 

Good Luck!

 

Ken

 

Thanks again Ken for this great contrib. It's all working like butter now!

Link to comment
Share on other sites

Hi Talle:

 

I guess you entered the html tags, ie., <b></b>, in the Category name in Admin - Catalog - Categories/Products. If I am right then you'd delete them from there: no one would normally enter html tags there because it wont work and osc doesn't work that way. If you want bold type the category names, you'd do it in the index.php, i.e., change the class for the heading title in this line:

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

For example, you could define a new class in the stylesheet.css:

h1 {
font-size:14px;
font-weight: bold;
}

and then change the

class="pageHeading"

to

class="h1"

You need to adjust the h1 class to fit into your site's style.

Let me know if this is want you want to achieve.

 

Ken

Edited by GemRock

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

...What do you mean by using your contrib to controll other pages? all i see in the header_tags_edit.php page is the products i have and not even one option to change indvidual pages titles by themself...

 

Plus i was meaning to ask you, is there a way that the product name will show up first and than the catagory? (i mean in the title bar) as you know google allwayes consider the first few words as his main indexing words and the rest of the words a an guiding words...

 

Thanks so much for everthing for the time and thoght you devoted to this contribution

You 1st question: when you open the edit header tags page, there are three columns you can enter text. The 1st is the title tag, where you can enter the title wording for that product as shown at the left most column.

 

2nd question: Yes. You could show them in whatever way you like. Could you post your current <Title> </Title> tag in your product_info.php so that I can have a look, and see how it could be changed?

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Hi Talle:

 

I guess you entered the html tags, ie., <b></b>, in the Category name in Admin - Catalog - Categories/Products. If I am right then you'd delete them from there: no one would normally enter html tags there because it wont work and osc doesn't work that way. If you want bold type the category names, you'd do it in the index.php, i.e., change the class for the heading title in this line:

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

For example, you could define a new class in the stylesheet.css:

h1 {
font-size:14px;
font-weight: bold;
}

and then change the

class="pageHeading"

to

class="h1"

You need to adjust the h1 class to fit into your site's style.

Let me know if this is want you want to achieve.

 

Ken

 

Hi Ken.

 

You´re right about me puting in those in the admin row.

 

I´ve tried your solution but it seems that the categories are not bold unless marked as in use. (I want the main categories to be underlined and bold all the time and the subcategories to be bold while in use...)

I did add text-decoration: underline; to your stylesheet input but it shouldn´t affect more than to underline the categories to, right?

 

Did I miss out on something?

 

what do you mean by this:

You need to adjust the h1 class to fit into your site's style.

Let me know if this is want you want to achieve.

?

 

this is what I´ve added:

h1 {
font-family: Verdana;
color: #000000;
font-size:14px;
font-weight: bold;
text-decoration: underline;
}

 

is it anything else I need to do in the stylesheet?

 

This is how my index.php look like after the changes:

 

<tr>
		<td class="h1"><?php echo HEADING_TITLE; ?></td>
		<td class="h1" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>

 

Sorry for being a trouble maker!!! :blush:

 

//Talle

Edited by Talle
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...