Different homepage content on sites using the same database
I have multiple sites and want to have different homepage content for each one.
While there is no built in way to have different homepage content for multiple sites running off the same VP-ASP database, it is possible to achieve with a fairly simple change to the code.
In default.asp, there is a SQL query which tells VP-ASP which content record to use as the homepage content.
What you need to do is modify this query in default.asp in each of your sites to look for a different content record.
For example, if you have two sites - My Site 1 and My Site 2 - and you want different homepage content for each, you would need to modify default.asp for each site as follows.
For MySite1, you want to use the content record with the Type - "MySite1Homepage".
In default.asp in your MySite 1 folder, look for the following lines -
if ucase(xdatabasetype) = "MYSQL" OR ucase(xdatabasetype) = "MYSQL351" OR ucase(xdatabasetype) = "SQLSERVER" then
sql="select * from content where homepage=1"
else
sql="select * from content where homepage=TRUE"
end if
You would need to remove all of those lines and replace them with the following -
sql="select * from content where messagetype = 'MySite1Homepage'"
For MySite 2, you want to use the content record "MySite2Hompage". You just need to open default.asp from the MySite 2 folder and complete exactly the same change as above, except using the following line to replace the existing lines -
sql="select * from content where messagetype = 'MySite2Homepage'"
Times Viewed:
2269 |
Added By:
Claire Banks |
Date Created:
7/22/2007 |
Last Updated:
7/24/2007 |
|