Predefined mysite profiles.

Events happening in the community are now at Drupal community events on www.drupal.org.
drupalprojects's picture

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

agentrickard's picture

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_data ADD pmid INT DEFAULT '0' NOT NULL AFTER uid ;
ALTER TABLE mysite_data ADD INDEX ( pmid ) ;

{mysite_page}
  pmid
  uid
  tmid
  page
  page_title
  layout
  style
  theme
  status

SQL query:
CREATE TABLE mysite_page (
pmid INT NOT NULL AUTO_INCREMENT ,
uid INT NOT NULL ,
tmid INT DEFAULT '0' NOT NULL ,
page SMALLINT NOT NULL ,
page_title VARCHAR( 80 ) NOT NULL ,
layout VARCHAR( 40 ) NOT NULL ,
style VARCHAR( 40 ) NOT NULL ,
theme VARCHAR( 40 ) NOT NULL ,
status TINYINT( 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 (
tmid INT NOT NULL AUTO_INCREMENT ,
cmid INT NOT NULL ,
template VARCHAR( 80 ) NOT NULL ,
description VARCHAR( 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 (
cmid INT NOT NULL AUTO_INCREMENT ,
category VARCHAR( 80 ) NOT NULL ,
parent INT NOT NULL ,
description VARCHAR( 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

The name

MySite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: