VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Customization
 Dynamic Title when using custom content page
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bardentech
Starting Member

34 Posts

Posted - September 21 2009 :  16:26:44  Show Profile  Reply with Quote
Most of my site is built using the shopcontent.asp method but I have a couple pages that use the shoppage_header and trailer files with a custom page in the middle of the two. One example is a google maps integration. The problem is that I use dynamic titles, keywords and descriptions. How can I populate these items when not building the page from the database?

Thanks
John

creativechaos
VP-ASP New User

Australia
64 Posts

Posted - September 23 2009 :  02:12:02  Show Profile  Visit creativechaos's Homepage  Reply with Quote
Hi John,

The dynamic meta tags are generated in shopheaders.asp.

If you are not using data from the content, products or categories tables, VPASP will load the default value of xtitle in your configuration settings.

You can overwrite this functionality by specifying your own title, description and keyword based on the filename of the page that is loading.

VPASP looks for the dynamic meta tags in session variables, so essentially all you need to do is overwrite these session variables with your own.

At the very top of shoppage_header.htm you could add something similar to the following:


 <%
	'SET THE META TAGS FOR NON STANDARD PAGES
    dim currenturl, compareurl
    
    currenturl = request.ServerVariables("URL")
    compareurl = mid(currenturl, InStrRev(currenturl, "/")+1)
    
    if lcase(compareurl) = "custompage.asp" then
    	setsess "dynamictitle", "TITLE"
        setsess "dynamicdescription", "DESCRIPTION"
        setsess "dynamickeywords", "KEYWORDS"
    end if
%>


Just alter the "custompage.asp" to the name of the file you want to specify your dynamic titles for and update those accordingly.

Add as many if ... end if statements as required for all of your custom pages.

Hope this helps!

Cheers,

Michael Dunkley
Creative Chaos
http://www.creativechaos.com.au
Go to Top of Page

borisvel
Starting Member

Slovenia
40 Posts

Posted - March 04 2012 :  05:54:34  Show Profile  Visit borisvel's Homepage  Reply with Quote
Hi Michael,

this code works for page names without additional parameters, but doesn't work for page names like

custompage.asp?par=value

Do you have solution for such cases?

Thanks for your help and

kind regards, Boris

www.finechance.com www.personaliziranadarila.si www.lingerie.si
Go to Top of Page

creativechaos
VP-ASP New User

Australia
64 Posts

Posted - March 05 2012 :  00:47:00  Show Profile  Visit creativechaos's Homepage  Reply with Quote
Hi Boris,

You'll need to add an additional section for each of the querystring attributes that affect the headers.

eg. If your custompage.asp script displays different content based on the value of the par variable, you'd probably want to update the script like:

<%
	'SET THE META TAGS FOR NON STANDARD PAGES
    dim currenturl, compareurl, qsvar
    
    currenturl = request.ServerVariables("URL")
    compareurl = mid(currenturl, InStrRev(currenturl, "/")+1)
    qsvar = cleanchars(request.querystring("par"))
    
    if lcase(compareurl) = "custompage.asp" then

    	if qsvar = "value1" then
    	    setsess "dynamictitle", "TITLE"
            setsess "dynamicdescription", "DESCRIPTION"
            setsess "dynamickeywords", "KEYWORDS"
        elseif qsvar = "value2" then
    	    setsess "dynamictitle", "TITLE"
            setsess "dynamicdescription", "DESCRIPTION"
            setsess "dynamickeywords", "KEYWORDS"
        else
    	    setsess "dynamictitle", "TITLE"
            setsess "dynamicdescription", "DESCRIPTION"
            setsess "dynamickeywords", "KEYWORDS"
        end if

    end if
%>


Hope this helps.

Regards
Michael Dunkley
Creative Chaos
http://www.creativechaos.com.au
Go to Top of Page

borisvel
Starting Member

Slovenia
40 Posts

Posted - March 05 2012 :  07:15:50  Show Profile  Visit borisvel's Homepage  Reply with Quote
Hi Michael,

many thanks for your generous help. It works perfekt!

Thanks and kind regards, Boris

www.finechance.com www.personaliziranadarila.si www.lingerie.si
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000