Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 11:09:36 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155538 Posts in 21715 Topics by 7737 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Code type content does not show - am I missing something?  (Read 407 times)
yuri

Offline Offline

Posts: 6


« on: April 13, 2010, 09:34:37 AM »

Hello to all bakers! Smiley
I have tryed WB and really liked the ease of content managent.
However there is one problem.
I need to keep custom HTML in as an output of page_content(). eg for the frontpage design which is different from the other pages.
I tried to create a page with type "code" putting HTML in the code form but nothing is returned of this HTML. Not a single character. If I enter this code in WYSIWYG it is returned fine, but can be easily broken by the WYSIWYG.

And on a related note, Is there a way/module to create custom code blocks and then reference them in WYSIWYG editor as say <?php global_content("my_block_name"); ?> eg to create side banners and widgets.

Thank you for sharing recipies Smiley


« Last Edit: April 13, 2010, 09:46:49 PM by yuri » Logged
yuri

Offline Offline

Posts: 6


« Reply #1 on: April 13, 2010, 10:51:03 PM »

Found a dirty fix but would like to know a better way

1 install droplet http://www.websitebakers.com/pages/droplets/official-library/content/showsection.php
2 edit the code as follows:

global $database, $wb;
$get_content = $database->query("SELECT content FROM ".TABLE_PREFIX."mod_code WHERE section_id = '$section'");
$fetch_content = $get_content->fetchRow();
$content = ($fetch_content['content']);
$wb->preprocess($content);
return $content;

Just changed the table name in select

3. I created a code type section - it is hidden anyway, does not parse HTML.
4. In WYSIWYG section on the same page add  [[showsection?section=xx]] 
and voila!
It is not too inconvenient but a hack is a hack. It would be better if code type functionality worked out of the box,
HTML be parsed to the output by the system core.
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #2 on: April 18, 2010, 05:48:04 PM »

Try this module here for HTML and/or JS output: http://www.websitebakers.com/pages/modules/various/html.php

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

yuri

Offline Offline

Posts: 6


« Reply #3 on: April 18, 2010, 11:32:28 PM »

Great tip, thanks!
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!