Hello. Is it possible to add custom pages to Dolphin? If so how can I do?
Thanks.
Hello. Is it possible to add custom pages to Dolphin? If so how can I do? Thanks. |
Yes.
The easiest way is to use the Page Builder - if it something you would rather not (or the builder is not capable of doing) use the page builder page style - create new pages like this.
Open faq.php and save it as the file name you want for your new page.
Then go to :
function PageCompMainCode and change the value of $ret to whatever HTML (or whatever) you would like on your new page.
let me know if that helps.
D |
Hi Dadniel You said: Open faq.php and save it as the file name you want for your new page. Then go to : function PageCompMainCode and change the value of $ret to whatever HTML (or whatever) you would like on your new page. sorry, can you be a little more detailed as to what can be achieved here, thank clubbeyourself |
At the bottom of faq.php is :::
function PageCompPageMainCode() { global $oTemplConfig;
$ret = _t( "_FAQ_INFO" );
return DesignBoxContent(_t( "_FAQ_H1", $site['title'] ), $ret, $oTemplConfig -> PageCompThird_db_num ); }
PageCompPageMainCode = is what s called to replace the __page_main_code__ within the template (html) file. which is controlled by::
$_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode();
page_main_code = the placeholder text (in the html template) being replaced by the function PageCompPageMainCode()
$ret is what is placed within the block.
So adding $ret = "<strong>Dadniel having fun doing sample work</strong>"
Would place (in bold) the words Dadniel having fun doing sample work within a designBox (one of the boxes on each page)
You could create an html page with any HTML editor (except WORD) and paste the html within $ret =
return DesignBoxContent(_t( "_FAQ_H1", $site['title'] ), $ret, $oTemplConfig -> PageCompThird_db_num );
The above line is what draws the box - and places the contents of $ret into it.
The _t( "_FAQ_H1", $site['title'] ) is what you want to place as the header (inside the area above the block)
To change that header ( and not use the language file - which is what the _t("xxx") does change the line as such..
return DesignBoxContent("My Header Here", $ret, $oTemplConfig -> PageCompThird_db_num );
Be careful not to paste the <html> or <body> or <head> tags from the html editor into the value of $ret - use the HTML between these tags as such...
<body>
all of the HTML between the open <body> tag and the close </body> tag can be placed within the $ret - and displayed within a designbox.
</body>
Another note:: if you paste the contents (HTML) within the $ret " ...... "; you have to be sure that the open quote close quote are the only ones - should you need to use a quote within the $ret value - simply add a \ before the quotation mark like so \" - this will tell PHP to ignore the very next character - the quote and keep including the rest up until the close quote.
I hope that helps.
D |
Thanks Dadniel Will read through properly and give it a go wen I am not so tired. Cheer clubbeyourself |
Sorry for the late response. I was too busy. @dadniel, wonderful explanation. I managed to create custom pages easily. One more question, if I add a html page into root directory, does it have conflict with other php files? |
Nothing you can add in an html file within your site will conflict with Dolphin. There will, however be no check for membership or member level for viewing that page. You will also have to work pretty hard to get the menu, header etc into that page design.
It is easier to just take the code between the body tags (of the HTML page you want on the site) and place it as the $ret ="....." value. then you're in the design, can add to and use the navigation bar (and sub menues) - it just makes more sense to create new pages using the method (or similar) as the instuction above.
Hope that helps.
D |
You can find a tutorial about How to make a custom page here. It has screen captures and an entire thread discussion. Good luck! |
Hello dadniel. How can I add a login check for the custom page? I want to make the custom page only viewable for logged in users. |
Hello dadniel. How can I add a login check for the custom page? I want to make the custom page only viewable for logged in users. i believe i would opt for mrpowless's "add a custom page tutorial" before i would struggle with what ddaniel is suggesting. well i was looking for the link with the video, but for some reason it has vanished. mrp if you have that video on how to add custom pages, please get it posted somewhere for this person to use it. that was the most adequate approach that i have seen since the create new page fucntion has never worked in 6.1 When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |