I have a custom module in the Magento installation, I am displaying the details of the specific module in the frontend under the URL, www.domain.com/modulename. Now I have two designs one for cms pages and other for the checkout and catalog pages. I want this custom module page in the frontend to be displayed in the CMS page theme but my default template set in the backend is other one.
Is there any possible way available to set the custom design for this frontend module page like we do for the cms pages under the design tab.
Please help. Thanks in Advance.
If you have your own custom module (extension), then you can control the display of it's pages via module controllers. That includes the package/theme configuration. Here is a function code that can be used to control your module package and theme selection.
public function myAction()
{
Mage::getSingleton('core/design_package')
->setPackageName("myPackage")
->setTheme("myTheme");
$this->loadLayout();
$this->renderLayout();
}
That's the only way at the moment of specifically setting custom package/theme for your action-controller-module.
Related
I'm quite new to Django and Wagtail, and I'm having some difficulty with what I think is a very basic use.
How do I allow Wagtail to edit an existing view's template, while serving that template using Django's serving mechanism?
Assume I have an app (HomePage) created to serve the site's main index (/). I have the HomePage's views set up to render template and certain elements dynamically. Now I want that template to be editable via Wagtail's CMS interface. Something as simple as an image on the frontpage, or a headline.
The closest I've gotten so far has been to follow the Wagtail beginner's tutorial to override the base HomePage class in my app's models.py. That only made my pages available via the /pages/ URL.
Thank you for any help.
Since your site's home page is not a Page object in the Wagtail sense, I'd suggest looking at Wagtail's facilities for managing non-page content - snippets and ModelAdmin would be possible candidates, but I reckon the site settings module would be the best fit.
A Setting model gives you a set of fields which can be configured for display in the Wagtail admin using a 'panels' definition, just like you'd get for a page model - with the important property that only one settings record exists per site. You can retrieve this record within your homepage view or template as shown in the docs, and output it on your template as desired.
One way do that, is to let Wagtail serve your homepage. You will need to change your project's url configuration accordingly, to make wagtail's urls serve the root of your site.
Then, you can pack your dynamic content into a custom template_tag and include in your homepage html template.
I am trying to have a custom plugin portlet in liferay for which I can customize the view page with velocity or free-marker template like we have for Asset Publisher in Liferay 6.2.
Requirement
I have a screen for admin (CRUD) through which data would be added in my custom tables through this portlet and then there is a VIEW page for all other users.
Now this portlet can be deployed on different sites or different pages with page-scope and the requirement is that it should have a different look & feel for different pages. Currently we are handling this scenario through deploying different themes to configure the look & Feel of the portlet, but we also need some layout changes which is a limitation with themes.
So I was thinking if we can utilize something similar to a velocity template for the View page but I am not sure where to start and whether liferay provides some easy way to do this. So that we create a template and upload it in the configuration and the VIEW page UI is changed.
I would be grateful if there are some pointers to help me in this direction or atleast can say about the feasibility part of it or an alternative.
Thanks
Environment: Liferay 6.2 GA1
If I already have a blog app done with Django and I want to use it with my new Django CMS site, is it okay to simply drop it into my new Django CMS project as a decoupled app and match anything /blog/ to the blog app as apposed to a Django CMS plugin? I guess what I need to know is when is it best to write my Django app as a plugin vs an entire app?
Thx
JeffC
Yes, but you don't just drop it into the urls.py, instead you can write an AppHook to tie your blog's URL scheme to a particular page in your CMS.
Plugins on the other hand are useful if you want to inserts particular aspects of you app into other page's placeholders - for example to show your latest 3 posts on the frontpage.
You might also want to include your blog's paths in a breadcrumb or menu on your site - in that case you need to write a custom Menu too.
Finally, it might also be useful to make use of django cms's placeholders in you blog model. His would allow you to post a variety of content via plugins.
The template I'm specifically talking about is the one that is used when a user add's a plugin to a page. Both in the admin area, and when modifying pages directly, it is displayed using an iframe.
The template itself is located cms/templates/admin/cms/page/plugin_change_form.html.
My problem is that I need some javascript to populate a drop down list within the form. All the javascript is run before the iframe is added to the page though, so I thought if I managed to edit the template I can tell the iframe to load some specific js. I can obviously just change the template directly, but that's a bit of an undesirable solution. I would rather keep it within the django application and even better have the js run only on specific plugins.
Any thoughts are appreciated.
You can set the change_form_template on your CMSPluginBase subclass, as CMSPluginBase is a subclass of django.contrib.admin.options.ModelAdmin.
Hello freinds I need help as to how can I add 2 iFrames in the Joomla's Default Back-end Template Khepri.
I want to show the Hosting cPanel and also another application's Control Panel in these iFrames.
Kindly help.
The correct way to do this is to add a new module to the admin. Log in to your Joomla admin then select Extensions > Module Manager > Administrator.
This will get you to the modules manager for the administrative area. It works just like the front end. Click New module, then select Custom HTML and put your iFrame code in there.