Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Creating a custom Page

  1. #1
    peterWAKA's Avatar
    Join Date
    Jun 2009
    Posts
    99

    Default Creating a custom Page

    Hi everyone.

    I am needing to learn how to create custom pages for my dolphin site.

    I have different music genres/styles for each mp3 that is uploaded and i want every music genre/style to have its own 'home page'. I do not want to use the admin's page builder as it doesn't reach the requirements that I need for this to work. If anyone has any help or maybe a copy of the unofficial dolphin manual (for mod trade) then that will be create!

    Thanks a lot guys.

    Pedro

  2. #2
    Administrator Smoge's Avatar
    Join Date
    Mar 2005
    Posts
    6,634
    Blog Entries
    5

    Default

    We don't usually use the Page Editor - it is too limited as often you want to do even more on a page, and it is best to have a dedicated .php page, and in some cases, template and css, for this. Also, there are issues with the Dolphin page editor, in regards to html parsing and so on - which is not an issue using a page generated as described below.

    Copy a simple page (like contact.php) to, for example, newpagename.php

    If you need a custom template page, then

    edit newpagename.php, change the value for below, to perhaps
    $_page['name_index'] = 500;


    and copy /public_html/templates/tmpl_uni/default.html to /public_html/templates/tmpl_uni/page_500.html, for example.

    If you change the value of $_page['name_index'] and dont create the new template, when the system can not find it, it will just use default.html

    If you need a custom css, you would do the same with
    $_page['css_name'] = 'sample.css';
    and copy / edit / use, for example
    newpagename.css

    In the sample.php page, you will see how it requires new lang string entries for
    $_page['header'] = _t( "_SAMPLE_H" );
    $_page['header_text'] = _t( "_SAMPLE_H1" );
    return DesignBoxContent( _t( "_SAMPLE_H1" ), _t( "_SAMPLE" ),

    And put these in the lang database, using the admin panel lang editor

    Smoge
    ModMySite Administrator

    Problems? Questions? Need modifications or other help with your site?

    Open A Ticket , Send Us An Email Or Give Us A Telephone Call +1 518-632-4152.

  3. #3
    peterWAKA's Avatar
    Join Date
    Jun 2009
    Posts
    99

    Thumbs up

    thanks a lot smoge.. That has made things a little more clearer in mind. Sorry to hastle you more,, then why do we use inc.php files (and inc/classes) files. I know they play a big part in it all.

  4. #4
    Administrator Smoge's Avatar
    Join Date
    Mar 2005
    Posts
    6,634
    Blog Entries
    5

    Default

    Well - in this way - you end up with a "dedicated page" for your new page - you can do with it what you want... and if additional functions are needed, you can add the related include files to the require_once statements.

    Is there other ways to do it? Perhaps - but this way is clean and direct.

    Smoge
    ModMySite Administrator

    Problems? Questions? Need modifications or other help with your site?

    Open A Ticket , Send Us An Email Or Give Us A Telephone Call +1 518-632-4152.

  5. #5
    peterWAKA's Avatar
    Join Date
    Jun 2009
    Posts
    99

    Default Thanks Smoge

    Thanks Smoge. Great help. Things are a bit more clearer now. My final question.

    For my page_(number) what would need to be in it (for a standard page)?

    Thanks,

    Pedro

    PS how do i prevent this from appearing (and replace it with my content) __page_main_code__
    Last edited by peterWAKA; 10-26-2009 at 01:09 PM.

  6. #6
    Administrator Smoge's Avatar
    Join Date
    Mar 2005
    Posts
    6,634
    Blog Entries
    5

    Default

    Quote Originally Posted by peterWAKA View Post
    For my page_(number) what would need to be in it (for a standard page)?
    You can give it any unused number... currently, Dolphin default pages use lower numbers... so we usually use 500, 501, 502... or even 800,801, and so on.

    I have not tried it - but one of my coders says you can use a name also... something like

    page_test123 and have a page_test123.html

    You can try it - it maybe less confusing when you are re-visiting your code later.

    Smoge
    ModMySite Administrator

    Problems? Questions? Need modifications or other help with your site?

    Open A Ticket , Send Us An Email Or Give Us A Telephone Call +1 518-632-4152.

  7. #7
    peterWAKA's Avatar
    Join Date
    Jun 2009
    Posts
    99

    Default

    I'm begining to make a little progress now. Not as easy as it seems. If anyone has any tips please let me know.

  8. #8
    peterWAKA's Avatar
    Join Date
    Jun 2009
    Posts
    99

    Default

    How do I get rid of "__page_main_code__" and add blocks?

  9. #9
    Administrator Smoge's Avatar
    Join Date
    Mar 2005
    Posts
    6,634
    Blog Entries
    5

    Default

    To add blocks, you need to make sure the code that supports those blocks are available to the php file (via require_once) , the proper SQL statements and so on are there, and place the tags in your template to call the blocks.

    Start with something simple, like

    function getBlockCode_News
    in addition to
    news.inc.php

    Smoge
    ModMySite Administrator

    Problems? Questions? Need modifications or other help with your site?

    Open A Ticket , Send Us An Email Or Give Us A Telephone Call +1 518-632-4152.

  10. #10
    peterWAKA's Avatar
    Join Date
    Jun 2009
    Posts
    99

    Default

    Ok 2 things.

    Firstly I found a good page on the BoonEx site:
    GenDolFAQs - Dolphin - Trac

    which gives a bit of help for those who wish to start their own page.

    Secondly, Thanks for all your help so far Smoge, but I'v another question.
    I want to save all my content on my database and let the script refer to that certain record on my database.

    How do I do this. I tried to look at other pages for some ideas but I'm gettng no where.

    Cheers
    Pedro

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Add a custom page in D7
    By nareshrevoori in forum Boonex Dolphin 7
    Replies: 2
    Last Post: 02-21-2010, 07:54 PM
  2. Custom Page
    By murr71 in forum General Issues, Comments, Questions
    Replies: 1
    Last Post: 06-15-2008, 06:22 AM
  3. Add custom fields to Browse page
    By jryan in forum FAQ & HOWTO
    Replies: 0
    Last Post: 05-12-2008, 11:48 AM
  4. Custom search page
    By ginger76 in forum Dolphin General Discussion v6.00 and above
    Replies: 6
    Last Post: 03-05-2008, 11:21 AM
  5. adding php to new custom page
    By luckylines in forum FAQ & HOWTO
    Replies: 6
    Last Post: 12-17-2007, 08:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •