• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Question

LEGEND ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

This may be an odd question but I figure this would be the best place to put
it.

I am creating a web site that allows animal rescues and shelter to have
thier own web sites. I created about a dozen templates and put them into a
folder for them to choose from.

When they sign up, I use cfdirectory action=create to create a new folder on
the web site based on their usename. Then I use cffile to copy over the
files that they can use for their pages. Effectively creating a new sub web
site.

However I need to make the each new web site pull the information for that
specific username. Is it possible to append the index.cfm to include a
<cfset> variable (probably Application.) equaling their username so the
database can then populate the site with their information as the user
navigates it?

What would be the best option to do this?


TOPICS
Advanced techniques

Views

346

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

I would give each user site it's own application.cfm file that is created when the folder is created. I would then set an application variable that I could use to pull that particular sites info from a database to populate the pages with.

Also I would store all the template files in one location and not copy them over to each individual site. That way if there is a template change you can make it in one spot and not have to update the same file in all site directories.

Hope that helps.

Trevor
www.burnette.us

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

Thanks for the idea. I think that would be best to create a custom
application.cfm per account.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

Hmmm. Now just have to figure out how to create a custom Application.cfm
using <cfcontent>.

Any ideas?


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

<cfset aName="Wally World">

<cfcontent variable="fileStuff">
<cfapplication name="#aName#>
</cfcontent>

<cffile action="write" file="c://websites/#aName#/application.cfm"
output="#fileStuff#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

LATEST
If you're on Linux make sure you create it as "Application.cfm", not "application.cfm"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation