Place Joomla module outside of index.php - php

I have a php page that is just a page I am linking to, from index.php.
When I try to use jdoc include to place the module, it doesn't work.
Should I do something special to make this php page a part of the Joomla template? Should I make it an article? Or is there just another way to load this module?

You can use this extension https://extensions.joomla.org/extension/jumi/ and on it you can put the path of your php file.

Related

Joomla php - load if not loaded

I have a joomla site. Bootstrap grip.css is loaded from a component.
But on pages where the component is not used the css file is not loaded and i need it to for styling.
How do create a code strip with IF not loaded then load /file in my index.php?
I'm not aware of any way to test whether a CSS file is loaded but you could use unset to unload grip.css (see https://joomla.stackexchange.com/a/4986/120 for details) and then use addStyleSheet or similar to load grip.css (see https://docs.joomla.org/J3.x:Adding_JavaScript_and_CSS_to_the_page for details).
Using this method can ensure grip.css is loaded exactly once on each page.

Moodle load an external javascript file from URL

I am using Moodle 3.1+. I want to load javascript from an external URL into Moodle. I have tried adding it through config file of theme using
$THEME->javascripts_footer = array('pusher.min');
But is not working. I want to integrate Pusher into Moodle and for that, I have to load the script from URL 'https://js.pusher.com/3.2/pusher.min.js'.
You may include library file like :
< script src="https://js.pusher.com/3.2/pusher.min.js"> in the footer file of your current theme.
It will load your library file.
Hope this will help you.
try
$PAGE->requires->js('https://js.pusher.com/3.2/pusher.min.js',true);
I think it will work.

including wordpress header in whmcs client area

For a project I'm working on I am trying to accomplish to match the whmcs client area to my wordpress site.
So far I've made a lot of progress but I'm stuck right now. I want to include the header of my wordpress site in whmcs.
I tried to implement the static code of my header in the header.tpl file of whmcs. It kind of works but the css conflicts with the main theme of whmcs.
The second thing I tried was to include it with php
<?php include(path/to/header.php'); ?>
Since the header.php is located in the main www directory and whmc is on a subdomain, I was advised to try this:
include($_SERVER['DOCUMENT_ROOT'].'/header.php');
Neither of those two methods worked.
The next thing I did was a new approach. I tried implementing the whmcs layout in wordpress with a plugin called advanced Iframe. It does work but it doesn't always behave as it should and I think it is an better idea to keep whmcs completely on its own subdomain (client.domain.com)
I am no coding genius, so I'm stuck at this point. Are there any workarounds for this?
Assuming the file you're wanting to include the header in is in the same directory as header.php, then you can use
<?php include(__DIR__.'/header.php'); ?>
I have found my mistake.
Since whmcs themes are .tpl, php can't be included directly and is not recommended. What I did was create a new folder in the theme directory with all the assets and a header.tpl file.
Then I included the header.tpl like this.
{include file="$template/header/header.tpl"}
The only downside is that I have to edit the menu manually when changes are made to the WordPress site

using require in codeigniter

I'm trying to use the uaparser.php library to detect the operating system, but when I use the following it just loads the github page for the library. This is the github page https://github.com/tobie/ua-parser/tree/master/php
<?php
require('uaparser.php');
?>
I've placed the file in my includes folder which resides in the Views directory. Perhaps, that is the source of the problem? Where would be an appropriate place to put this file?
I assume when you downloaded uaparser.php you clicked File->Save Page As... (or something simular). That is why the page loads when you require/include it.
Open up the local file uaparser.php and confirm that it is actually the php code and not the html of the page.
Doing this is fine anywhere you need it.
You can place this anywhere, but for codeigniter it should be in the 3rd party folder, but it doesn't matter.

Adding php page to drupal7

I have googled my question many times but i cant find a good solution. I want to add a php page into drupal.
Is there a way to call(perhaps a menu link) a php page within the existing drupal(template) with an include or something?
From http://drupal.org/node/1046700
Drupal 7 Core contains a module called "PHP filter". A fresh install
of Drupal 7 has this module disabled by default. We need to enable it.
Any page or block text area can include PHP code in drupal, if the PHP filter is enabled and the user has permission to use it.
If you want to add a link to a PHP file completely outside of the drupal CMS, you can do so too.
example)
<a href="http://yoursite.com/your/physical/path/to/a/php/file.php">
external PHP file
</a>
unable to understand the question completely ... is the PHP page to be used within a module?? perhaps use 'file' and 'file path' in the hook_menu of your module to include the page .... or if its in block level would suggest the previous answer from #DownDown ....

Categories