adding image in footer in drupal 7 - php

I am new to Drupal.I am using marinelli theam.I created one block and placed in footer section with some text.In Drupal 7 how to add an image in a block located in footer section..I tried using Full HTML and filtered HTML Text format.It was not added image.

Make sure the path to the image is correct.
1- Enable "PHP Filter" module, in Drupal Core modules.
2- inside the block content, make sure that the text format is "PHP code" and then type the following code:
global $base_path;
print "<img alth='' src='" . $base_path . "PATH_TO_IMAGE/image.jpg' />";
Hope this works... Muhammad.

You can directly use a wysiwyg editor and use insert picture any where you want. I prefer CKEditor.

What you can do is go to edit mode of your block. Then add image link using the following formatt:
<img src="../sites/all/themes/marinelli /images/[your imagename and extension]">
If you haven't got through, I hope this helps.

Related

magento product attribute with wysiwyg, src="{{media url="image.jpg"}} not parsed

Hi I'm working with Magento 1.7
I create a text area attribute with wysiwyg allowed and visible on the product page.
when I insert an image I can see only the html text of the attribute, images don’t appear.
If I analyse the generated html code, I can see that the code included by the wysiwyg editor like
src="{{media url="image.jpg"}}
has not been parsed.
The code I use is:
echo $ _Product-> getData ('technical_support');
I tried to print the attribute with
echo $this->helper('cms')->getBlockTemplateProcessor()->filter($this->helper('catalog/output')->productAttribute($this->getProduct(), nl2br($_technical_support), 'technical_support') );
But the attribute is not printed
How can I fix it?
Thanks for your help.
This is how u have to call the images through wysiwyg editor. You have to click show/hide button. Then u can write html tags there. Here is the example
<p class="home-callout"><img src="{{skin url='images/ph_callout_left_rebel.jpg'}}" alt="" /></p>
Flower brackets are missing in ur code.
And for attribute, your process is wrong.. Follow this link Calling an attribute in a CMS block in magento

YiiStrap icons are invisible

I downloaded fresh yiinitializr archive (from here) unpacked it. After I configured db etc. I wanted to print a icon, just like it's mentioned at the yiistrap site:
<?php echo TbHtml::icon(TbHtml::ICON_GLASS); ?>
And it's invisible. There is a proper HTML code:
<i class="icon-glass"></i>
The bootstrap.min.js and bootstrap.min.css are also attached. Why it's still invisible?
Have you included the icon image files. Bootstrap uses the glyphicons from http://glyphicons.com/ you need to include the icons image files.

CKEditor outputting text doesn't match input when using htmlspecialchars_decode(stripslashes($variable))

I'm trying to use CKEditor to input rich text into my database, which works except the formatting is not the same when I try to output the rich text the user entered. The position of elements such as pictures is incorrect.
I currently have the following code:
Input:
$pitch = htmlspecialchars($_POST['editor1']);
$sql = mysql_query("UPDATE projects SET pitch='$pitch' WHERE id='$proj_id'");
Output:
$pitch = htmlspecialchars_decode(stripslashes($pitch));
The result is then echoed back which creates the incorrect formatting.
Does anyone know what I'm doing wrong?
This has nothing to do with PHP.
Contents of the framed editor (which you use) is styled by the contents.css file which you can find in the main CKEditor directory. However, this stylesheet is not used on your page, so content created in editor is not styled by the same rules.
The correct approach is - style content on your site and then copy (or somehow reuse, e.g. by setting config.bodyClass and config.contentsCss) these styles in editor contents.
Remember, that you also need to set styles available in styles drop down. They are by default configured as for the sample, but when you'll change available styles, you need to update styles.js file too.

adding a background-image to body in a cakephp layout with jQuery

I'm using cakephp 2 and I'm trying to allow my users to upload an image which is then used as the background for their page.
I have the images uploading fine and saving to a (webroot)files/User/$userid/$bodybgimage. I've also got the name of the image in the database.
Trouble is I want because I don't know in advance what user id is going to be requesting their background image I can't put their background in the stylesheet, so I'm trying to get it added in the default layout. I've tried to add with jquery: (the image filename is in $bodybgimage)
<?php if(!$bodybgimage == '') {?>
$('body').css('background-image', 'url('<?php echo '../files/User/'.$userId.'/'.$bodybgimage; ?>')');
<?php }?>
But this seems to just remove everystyle I had for the body!
I also tried doing adding it straight to the body tag like so:
<body<?php if(!$bodybgimage == '') echo ' style="background-image:url(../files/User/'.$userId.'/'.$bodybgimage.')"';?>>
But again to no avail. Can anyone help me out. I know the image and all's there because if I put the background-image style in the stylesheet the image pops up ok. There must be a sensible way to do this that I'm missing. Plz help!
Please can you try to omit the "../" before the files as i assume that your images founded in a folder named files beside your script not ?

Wordpress - I want to add a <div></div> with a Plugin

I'm trying to learn wordpress and php.
Basically, I want the
function draw_ad() {
echo "IMAGE CODE INSIDE A DIV";
// echoing an image inside a div -- StackOverflow does not allow me to post img tags : )
}
add_action('the_content', 'display_ad');
===
Basically, I want to add a picture and be able to manipulate the "left" and "top" css options... but with a plugin. So it will be like a strange picture that covers whatever the area on the screen that I want it to cover :P.
Yes, it is kind of sloppy, but that's what I was asked to do : P.
The add_action('the_content', 'display_ad') kind of does it, but it removes the whole content.
Is there a better way to do this?
Is there a way to tell the wordpress PLUGIN to add this , say, before the theme's header, and not content? (As in, be able to put this thing wherever you want to in the html body tags?
Thank you, guys!
From theme developing I am sure you can add code to the header and at the end of the body tag. (wp-header, wp-footer)
The best thing is to insert the picture tag at the end of the body and style it with position:fixed;. You don't need a div around the img tag.

Categories