Forums | Mahara Community

Support /
Embed Flash into Home page


anonymous profile picture
Account deleted
Posts: 3

15 March 2009, 3:13

I am trying to put some flash on my home page, however the Mahara Admin Editor always clean my <embed> tags.

Is there any way I can extend the editor, or disable the clean code function?

Heinz Krettek's profile picture
Posts: 480

15 March 2009, 4:16

Hi Macy,

do you  think about adding stuff like at the homepage area of mahara.org? Please check the setting of allowed filetypes in the admin section.

HTH Heinz

anonymous profile picture
Account deleted
Posts: 3

15 March 2009, 4:36

Hi Heniz.

Could you please tell me how to set the allowed filetypes for admin?

The editor always trying to clean my HTML tags.

Heinz Krettek's profile picture
Posts: 480

15 March 2009, 4:51

Hi Macy,

which version of Mahara do you use? In Mahara 1.0.x you have to check 2 settings:

  • /admin/extensions/pluginconfig.php?plugintype=artefact&pluginname=file&type=file
  • /admin/extensions/pluginconfig.php?plugintype=blocktype&pluginname=file/internalmedia 


for the allowed filetypes.

In Mahara 1.1.x it's only the second one to check.

Heinz

anonymous profile picture
Account deleted
Posts: 12

15 March 2009, 12:42

Hi, Heinz and Macy. I posted a question that related to this on the developer forum.

First off, thanks, Heinz, for answering Macy's question. Macy followed your advice and is now able to embed flash objects using <embed> on the home page. 

However, it appears that, in order for her to achieve this, she had to UNCHECK the two "SWF Flash Movie" settings as opposed to CHECK them. Doesn't that mean that, now, Mahara site users cannot embed their own SWF objects? 

Is allowing <embed>ed objects in the homepage and for upload by users mutually exclusive? Thanks in advance to anybody who can shed some light on this for us.

p.s. we are indeed using Mahara 1.0.10.

Best,

Andrei

anonymous profile picture
Account deleted
Posts: 1643

15 March 2009, 17:30

Hi - I find it highly unlikely that the two settings have anything to do with embedding flash content on the homepage, actually. Those settings are for 1. uploading flash files, then 2. being allowed to embed them using the 'internal media' blocktype in a View. There's probably something else you did to make the embed code work on the homepage.

I gave you an answer in the development forum about TinyMCE stripping things, hope it helps you Smile

anonymous profile picture
Account deleted
Posts: 12

17 March 2009, 21:19

Hi, Nigel.

Thanks for your help here and on the Developer forum. As you may have seen from Macy's posting, her solution was to just work around the database-stored content altogether. The hack suits our purpose, although the obvious disadvantage is that we lose the ability to have different hompage content depending on whether or not a user's logged in.Ironically, we ended up not embedding any objects, anyway--after all!

So, I didn't work through TinyMCE after all -- but I probably will do so once I'm onto the next iteration of my development effort. I'll post whatever solution I come up with.

anonymous profile picture
Account deleted
Posts: 3

16 March 2009, 2:19

Hi Andrei:

 This is how I did it.

I would like to post the solution on the forums to share with Mahara users.

Basically what I have done was creating a new template for index.php

 Steps:

  1. Create a template you would like to use for the new page.( you can copy the template form other template files, such as index.tpl)
  2. Upload your template in your template folder
  3. Change your index.php template path to load new template.

1. Create a template

 {$page_content}

Is the part loads the data from the database. You can delete this part to make the page only shows the template data.(It is optional, if you would like to keep the page partly editable)

 {include file="footer.tpl"}

This means include a template called"footer.tpl"

At this template page you can feel free to add HTML, CSS, Javascript, as well as Flash.

2. Upload your template in your template folder

Upload your new template to the folder of the template that you are currently using.

3.Change your index.php template path to load new template.

In the index.php file which located in the main directory

my was: public_html/index.php

in line 48, the last line before the end of PHP "?>"

I changed the path of template from"index.tpl" into "welcome_home.tpl"

("welcome_homt.tpl" is the template I created for new home template).

 

partly of my index.php looks like this:

if (!$USER->is_logged_in()) {
    $pagename = 'loggedouthome';
    $lang = param_alphanumext('lang', null);
    if (!empty($lang)) {
        $SESSION->set('lang', $lang);
    }
}
else {
    $pagename = 'home';
}

$smarty = smarty();
$smarty->assign('page_content', get_site_page_content($pagename));
$smarty->display('welcome_home.tpl');

 

8 results