Include divi section on php page - divi-theme

I'm trying to add a divi section to a php page (these are documentation pages which we generate automatically with a build script). The code snippet below works for non-divi shortcodes, but not for the divi shortcodes.
<?php
require($_SERVER['DOCUMENT_ROOT']."/wp-load.php");
get_header();
...
echo do_shortcode('[et_pb_section global_module="9822"][/et_pb_section]');
...
getfooter();
Instead of getting rendered the shortcode itself is shown on the page.
Any thoughts on how I can get this working?

I found a possible solution here:
https://liampedleydesign.co.uk/placing-divi-modules-anywhere-using-shortcodes/
The shortcode code is slightly different for Divi:
echo do_shortcode('[showmodule id="9822"]');

Related

Magento getChildHTML from a different class

On the login page's phtml file there is a line that adds the html for a remember me checkbox using: <?php echo $this->getChildHtml('persistent.remember.me'); ?>
I want this same checkbox to also appear in a different part of the website, but when I add this same line to that section's phtml, nothing shows up. I logged out the classes of the $this object in the two files, for the login page its Mage_Customer_Block_Form_Login, and for the other section its Mage_Page_Block_Html_Header.
I'm guessing the difference in classes causes the remember me to not be found in the other sections call to add it. Is there any way to add this remember me html to this page even though their $this classes are not the same?
You can use following code in place of your code
$this->getLayout()->createBlock('persistent/form_remember')->setTemplate('persistent/remember_me.phtml')->toHtml();
Or add following code to add block in your page's handle to use your same code with $this
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />

How to edit the source code of joomla individual pages

I have a Joomla site, and I want to remove a the footer div from a page without it affecting it on the other pages. Please is there a way I can do it.
You have a couple options - you should be able to set additional CSS on that article to hide the particular footer div for that one individual page without issue.
Additionally you could install a plugin like Sourcerer that allows for PHP coding directly into articles in Joomla! (which comes in REALLY handy!); then you could remove it programmatically as well if necessarily.
Alternatively - you could create a template override for that particular template/page and edit the PHP there to reflect appropriate course of action for that URL/Page.
I tried to list them in order of easiest to most difficult.
It´s not a clean method to hide template-elements by using CSS (display:none). And for your intension you dont´t need a external plugin.
Try a page-option in your template index.php.
First - to get page-options work:
<?php $pageoption1 = JRequest::getVar( 'Itemid', '' ); $pageoption2 = JRequest::getVar( 'page', '' ); $pageoption3 = JRequest::getVar( 'option', '' ); ?>
And further:
<?php if ($pageoption1 == '1') { ?>
This text will be visible only in the page with Menu Item ID 1
<?php } ?>
This works lately in Joomla 2.5.X - for newer version i think it will also work fine.

how to change html file with url get id in php

For example I have two html files sample1.html and sample2.html and I want to show them in one php file, like if I entered www.mydomain.com/index.php?show=sample1 will show the sampl1.html and ?show=sample2 will show sample2.html but in only one page
Something like that ?
<? include($_GET['show'].".html"); ?>
It not the a secure answer but I think this is what you want...

Remove Trailing Slash from Magento URL

I understand there are many answered questions on this particular issue but I haven't found anything specific to Magento, and I was wondering if changing the .htaccess file will have repercussions in my Magento store.
Basically I have links in my navigation that go straight to a filtered category page so they look as follows..
Example.com/hairproducts.html?manufacturer=412
However when I click these links they end up navigating to the URL with a trailing slash...
Example.com/hairproducts.html?manufacturer=412/
which then ignores the filter and takes them to the category page.
Cheers for any help.
I assume you have the urls generated in a phtml file like this:
<?php echo $this->getUrl('hairproducts.html?manufacturer=412'); ?>
or in a block/page content like this
{{store url="hairproducts.html?manufacturer=412"}}
Change them to this:
In a phtml file:
<?php echo $this->getUrl('', array('_direct'=>'hairproducts.html', '_query'=>'manufacturer=412'); ?>
or in a block/page content
{{store _direct="hairproducts.html" _query="manufacturer=412"}}
If I assumed wrong then post the way you are generating the urls.

including phtml file in phtml in magento

Hi I have added the inchoo featured products but want them to show in the header so show on everypage, i tried moving the code, i tried:
echo $this->getLayout()->createBlock('Mage_Adminhtml_Block_Template', 'block-name')->setData('template', 'inchoo/block_featured_products.phtml')->toHtml()
Im kind of new to magento so i don't know
thanks
Graham
Create a CMS static block and give a identifier name to that, lets say "featured_product".
Open page.xml file from app/design/frontend/default/YOURTEMPLATE/layout/page.xml
Find the section html_header, now add the following code
<block type="cms/block" name="header_block"><action method="setBlockId"><block_id>featured_product</block_id></action></block>
Next open the app/design/frontend/default/YOURTEMPLATE/template/page/html/header.phtml file.
Find the area to design and add the following code in there :
<?php echo $this->getChildHtml('featured_product') ?>
Clean cache and test your page.

Resources