Posted by drupalprojects on October 5, 2007 at 9:12pm
hi
I think this module will almost fit my needs, but I'm interested in creating 2-3 different mysite templates (let's call it profiles, ok?). For example: I want to create one mysite profile to display owners blog posts for user type - bloggers and second mysite profile to display owners photos for user type - photographer. This is just an example.
I don't want users to create their mysite instances from scratch, but I want to create certain types of predefined mysite profiles users should be able to choose from.
Is this possible to do that via writing a module: does current api support this or it should be improved?
thanks.
Comments
In the works
This feature has already been requested, and is being planned for the 5.x.3 release. You could probably do this now, but it really requires some changes to the core module to implement.
See http://drupal.org/node/145423.
The concept is "page templates" for MySite, which follows the new MyYahoo! model. The administrator will be able to define a 'template' page and users will be able to select which template page(s) to add to their collection.
Problem is, first we need to make the module support multiple pages, which is a fairly complex task.
In terms of templates, the relevant notes are the new db schema:
{mysite_data}
mid
uid
pmid
title
type
type_id
sort
format
position
settings
locked
SQL query:
ALTER TABLE
mysite_dataADDpmidINT DEFAULT '0' NOT NULL AFTERuid;ALTER TABLE
mysite_dataADD INDEX (pmid) ;{mysite_page}
pmid
uid
tmid
page
page_title
layout
style
theme
status
SQL query:
CREATE TABLE
mysite_page(pmidINT NOT NULL AUTO_INCREMENT ,uidINT NOT NULL ,tmidINT DEFAULT '0' NOT NULL ,pageSMALLINT NOT NULL ,page_titleVARCHAR( 80 ) NOT NULL ,layoutVARCHAR( 40 ) NOT NULL ,styleVARCHAR( 40 ) NOT NULL ,themeVARCHAR( 40 ) NOT NULL ,statusTINYINT( 1 ) NOT NULL ,PRIMARY KEY (
pmid) ,INDEX (
uid,tmid,page)) TYPE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
{mysite_template}
tmid
cmid
template
description
SQL query:
CREATE TABLE
mysite_template(tmidINT NOT NULL AUTO_INCREMENT ,cmidINT NOT NULL ,templateVARCHAR( 80 ) NOT NULL ,descriptionVARCHAR( 255 ) ,PRIMARY KEY (
tmid) ,INDEX (
cmid)) TYPE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
{mysite_template_category}
cmid
category
parent
description
SQL query:
CREATE TABLE
mysite_template_category(cmidINT NOT NULL AUTO_INCREMENT ,categoryVARCHAR( 80 ) NOT NULL ,parentINT NOT NULL ,descriptionVARCHAR( 255 ) NOT NULL ,PRIMARY KEY (
cmid) ,INDEX (
parent)) TYPE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
In plain English, this schema will support the creation and replication of the templates you want. Storage of the template data will be done within the current {mysite_data} table. Pages that are assigned to a template (tmid) will be available for insertion into a user's collection. The process will work much like Default Content does now. If you look at mysite_create_account in the API, you'll see the method we'll use to insert a page into the user's collection. The template data will be loaded and inserted into the user's collection.
There will need to be a new module
mysite_template, which I haven't started working on yet. If you're interested in trying to write it, let me know.Once these features are added, development on 5.x will stop and I'll port the module up to Drupal 6.
--
http://ken.therickards.com/
http://savannahnow.com/user/2
http://blufftontoday.com/user/3
--
http://ken.therickards.com/
The name
And the name is "templates" not "profiles."
--
http://ken.therickards.com/
http://savannahnow.com/user/2
http://blufftontoday.com/user/3
--
http://ken.therickards.com/