How to display html content in block in Drupal 6? - drupal-6

How can i display external(from server) html content into block region.
let me tell you what i did so far is i created a new block on my site called sitemap and put some php code
<?php include('../sitemap/sitemap.html'); ?>
and set this block region to footer.
But it show nothing so plz help me so i do it.

Maybe the include file path is wrong. For better results, you can put that file in the themes folder and call it.
<?php include(path_to_theme().'/sitemap.html'); ?>

Related

Prestashop 1.7 include inline SVG in tpl file

I am trying to include an SVG inside my tpl file like this :
<?php echo file_get_contents("icon.svg"); ?>
Do you have some idea ?
Finally, I found a trick to include inline SVG file using the template system.
So I just create a folder named _svg in the templates folder of the theme. I renamed my icon.svg file to icon.tpl and I included it using the following code:
{include file="_svg/icon.tpl"}
If you need a variable (for exemple in a loop, use :
{include file="_svg/icon-{$var.value}.tpl"}
If you have other ideas, do not hesitate to let me know !
See you!

Broken links resulting from php include references

I'm learning php but am up against a wall right now with a referencing issue. I've searched a lot but I can't find any posts with my exact structural problem. Hoping to master this hurdle so I can move toward the next...
My basic file structure something like:
domain.com/
home.php
images/
global/
nav/
nav-img.jpg
includes/
menu.php
fruit/
apples/
red/
gala/
gala.php
I want to create a global path establishing my web root directory that I can reference on the fly in each page wherever it resides. BUT other posts on this general topic give [10] different functions I can use. I just want [1]. Also, I don't know where to put [for example] define(ROOT), or how to call it from an individual page.
Will define(ROOT) work for my situation?
Knowing that all pages use [menu.php], my obstacle:
From gala/gala.php - when I click on [home], it looks for:
/fruit/apples/red/gala/home.php [does not exist, of course!]
Also, trying to AVOID these [2] things if possible:
I. Using html file references in gala.php like this: ../../../../includes/menu.php
to find the correct global include.
II. And avoid using link references in menu.php like this: /images/global/nav/nav-img.jpg
Any feedback would be appreciated [+] or [-]. Thanks a lot.
Ok, here's what I did that seemed the best:
For I. and II. to avoid using so many ../../../../
in all the src="" and href="" I just settled and used site-relative file references with leading slashes, such as "/includes/menu.php" which would get me to the site root, building the file's location from there.
For the global file reference, BOTH of these worked:
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/";
?>
// in `<head>` section
And using <?php include ('menu.php'); ?>
OR THIS ONE WORKED TOO:
<?php
define('ROOT',$_SERVER['DOCUMENT_ROOT']);
define('INCLUDES',ROOT.'/includes/');
?>
// in `<head>` section
And using <?php include (INCLUDES.'menu.php'); ?> in a file at another level.

Zend framework 2 - Add a subview in layout?

I have three layout views for render my web page (one for logged users, other for unlogged users and one for admin users).
These layouts have the same footers section. This footer is very complex and I'd like centralizing changes to a single footer view.
How I can add a subview inside the layout view, such that the layout will have the following code for rendering the content returned by actionControler?
<?php echo $this->content; ?>
And the following code, but this is always same template and isn't returned by the actionController:
<?php echo $this->footer; ?>
Do I have to modify onBootstrap method?
If the footer itself is simple you should be able to use the Zend\View\Helper\Partial helper to render a phtml file. To do this (inside your layout):
<?php echo $this->partial('view path'); ?>
If the footer requires some logic, it maybe best to look at creating a view helper.

display only the content of a page in lightbox2 in drupal

I am using drupal.I have to display the content of a page in lightbox2.(only the content not header,footer,menubar,sidebar etc).The url of that content node is http://mysite.com/node/1.
I have included the lightbox2 module and used the below code
<li>click here to see node content</li>
But the lightbox displays the whole page not only the content.i need only the text content.
One more option in that you can pass a parameter in get method for lightbox2 content.
Based on the parameter add condition in page.tpl.php
Not the best of the solution, but achievable.
Create a new page.tpl for node/1 and print only $content in this.
this way you will make sure you only get content and nothing else
I Agree with Vaibhav Jain, you can create a theme for the page without the header, left and right, footer. only the content and call that page inside the lightbox

drag and drop in drupal 6 block

I am working on drupal. I am facing problem in block. There is no drag and drop function on the page. When i dissable javascript on my browser it show weight option to set manually, after enable again it is not showing.
can any one suggest about this type of problem. if there is any css related issue please suggest me about this
Usually, when this happens, the <?php print $scripts; ?> call in your theme's page.tpl.php is missing, so that Drupal's JavaScript files aren't being included (it's JavaScript that creates the drag and drop features). Or there is an error/conflict in your JavaScript/jQuery.
Is $scripts being printed in your theme?

Resources