Not logged in. · Lost password · Register
Forum: General Discussion Syntax and Usage RSS
How do I embed a Dokuwiki page in another web page but as plain text
keveen2 #1
Member since Sep 2007 · 21 posts
Group memberships: Members
Show profile · Link to this post
Subject: How do I embed a Dokuwiki page in another web page but as plain text
I found some information on how to embed a page into another website such as Joomla with this syntax:

<html><body>
    <iframe width="100%" height="500px" src="http://localhost:85/dokuwiki2/doku.php?do=export_xhtml&amp;id=blog/petrol_price_rises_and_global_markets">
    <a href="http://localhost:85/dokuwiki2/doku.php?do=export_xhtml&amp;id=blog/petrol_price_rises_and_global_markets">
    </iframe>
</body></html>

which removes the header and footer and inserts just the page. It works well except with my template (r7throot3) the text pushes out of its white box container. I can't work out how to correct that or to get rid of the template and just have white background and black text.
http://www.healthwealthandmusic.co.uk/wikis/homepage.html
http://dokuwiki.healthwealthandmusic.co.uk
grahack #2
Member since May 2007 · 164 posts · Location: Nantes, France
Group memberships: Members
Show profile · Link to this post
I don't know if this has been done before, but you could choose your template with a _GET parameter.
Somewhere in your conf/local.protected.php, add
$allowed_tpls = array( '', 'default', 'monobook' ); // maybe there is a DW function to detect available ones
if ( in_array( $_GET['tpl'], $allowed_tpls )) $conf['template'] = $_GET['tpl'];
Now appending &tpl=a_template will select it.
grahack #3
Member since May 2007 · 164 posts · Location: Nantes, France
Group memberships: Members
Show profile · Link to this post
Leaving '' in the template conf item was not a good idea. DW defaults correctly anyway.
Better if you don't want to have css things missing:
$allowed_tpls = array( 'default', 'r7throot3' ); // maybe there is a DW function to detect available ones
if ( in_array( $_GET['tpl'], $allowed_tpls )) $conf['template'] = $_GET['tpl'];
keveen2 #4
Member since Sep 2007 · 21 posts
Group memberships: Members
Show profile · Link to this post
Sorry, I didn't make my aim clearer. I meant how to embed a Dokuwiki page into any other html page in another non-Dokuwiki website, for example in a page on my Joomla site. I don't necessarily want to login or anyhting, just show a particular Dokuwiki page. I was hoping I could use something like the <embed> funtion that is usually used for video. As I said the iframe sort of works but I was hoping to find something neater - just the text on a white background for example. Wish I were a programmer! Or maybe I didn't undestand the replies? :huh:
http://www.healthwealthandmusic.co.uk/wikis/homepage.html
http://dokuwiki.healthwealthandmusic.co.uk
grahack #5
Member since May 2007 · 164 posts · Location: Nantes, France
Group memberships: Members
Show profile · Link to this post
I understood your goal. My piece of code will just help you to switch the DW template just for one request: the inclusion in your Joomla page. You wanted to have black text on white background, so:
1) add my piece of code in your local.protected.php
2) keep the default template in your tpl folder, and try your iframe trick appending &tpl=default at the end of the url of the page you want to embed.
I can remember someone who wanted to do the same, try to search on the forum again.
Abacus #6
Member since Nov 2007 · 29 posts
Group memberships: Members
Show profile · Link to this post
That would be me that did the embedding within a web site. Have a look at the following example..

http://www.jedsite.info/afv-golf/golf/gefas_series/gefas-s…

The syntax is obvious and it relies on a bit of javascript to actually do the embedding.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please note the verification code from the picture into the text field next to it.
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 1.6.4, © 2003-7 by Yves Goergen
Current time: 2008-08-21, 21:11:24 (UTC +02:00)
WikiForumIRCBugsTranslate