CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 How can I place an array of category names from database into the meta keywords of a page?

Print topic Send  topic

Author Message
joejac

Posts: 242
Posted: 02/10/2008, 8:45 AM

Hello,
I have a page that is been generated with the names of child categories under the parent category that is passed to the page via a parameter con the URL like this:

/menu.php?category_no=9

On menu page I display category_name for all corresponding child categories of parent category, in this case No 9.

I want all these category names to be placed in the meta keywords separated by ", " for menu.php so I use the solution from this post:

http://forums.yessoftware.com/posts.php?post_id=72791

Unfortunately if I have for example 6 child categories, I get on the meta keyword only the last one, so I miss the other 5 category names. I do not know how can I create an array, in perhaps the Before Show event, assign the value of this array to {category_name} and pass it to the meta keywords in the menu.html template.

Any detailed solution with its code is greatly appreciated.

Thanks a lot and best regards
joejac
View profile  Send private message
JayEdgar


Posts: 77
Posted: 02/10/2008, 5:15 PM

Whatever you do, you probably want to do it in the After Page Initialize event.

Cheers,

Jay
View profile  Send private message
joejac

Posts: 242
Posted: 02/11/2008, 4:19 AM

Thanks JayEdgar,

Any suggestion with the possible code to accomplish this? I am a beginner :)
Regards
joejac
View profile  Send private message
JayEdgar


Posts: 77
Posted: 02/11/2008, 5:03 AM

I have no idea if this will work, and this is what I'd try:

*Go into HTML view
*Remove entire <meta> or whatever tag.
*Add a label, give it an appropriate name
*add code to the 'before show' event for the label. I'm not sure how you'll access the label without accessing a formname first - hit $ and it should show up in the intellisense.

If you find the label name in the intellisense, I give it an 80% chance of working. If not, 40%.

Good luck,

Jay
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.