How to use relative file path for the images in elgg/mod folder? - elgg

In elgg 1.7.10, I have to use a absolute full path for all the images, how can i use the relative path for plugins in the mod folder?
thanks!

Just Use the "/mod/[pluginname]/[graphic_folder]/image.jpg"
Let me know if you were asking some thing else.
Thanks.

Try
elgg_get_plugins_path() . 'folderName/pages/add.php';

Related

Why can't I overwrite my style.css on my localhost?

I have designed my website with css now, but I have a big problem:
When I save my style.css and upload it to my localhost server, it doesn't overwrite my previous.
So it is not possible to change anything.
The code itself works.
I hope you can help me.
Daniel.
you should clean your browser cache plus check that using the same classes or ids for the new file with the same CSS file and take care of any ! important css .

CSS Root Path for Windows different with Mac?

I just started learning Compass by watching tutorial video. But my question is for general CSS.
Here's how the directory looks like:
/root
/images
/mySprites.png
/javascript
/stylesheets
/myStyle.css
index.html
When auto-generating sprites, Compass output the path like this:
url('/images/mySprites.png');
But using Chrome in Windows, that path leads to stylesheets/images/mysprites.png and thus not showing up.
He's using Chrome in Mac and the sprites are shown correctly.
I know / is used to start from root folder, but is it not working in Windows?
The / in the first is not one of the CSS rules if some browsers understand that you are pointing to the root folder, they are doing it on their own and there is no such thing in CSS. http://www.w3.org/TR/CSS21/syndata.html#uri
So, the best way is to enter paths relative to the CSS file, not the document root or enter full URL like this: http://example.com/images/mySprite.png
All the best wishes,
Mohammad Ali Sharpasand
As mentioned above, just use ".../images/mysprites.png" as that will instruct the CSS to look one level above it's containing folder.
I hope this answers your question!

Magento, add Css file from media folder

Is it possible tu add a Css file from the "media" folder!?
In the normal way we put the css file into the "skin" folder and then we use "addCss()"!
But I need it to be in the "media" folder !
Thanks for Helping
$path = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'my_folder/';
$file=$this->getTypeCss();
$param='rel="stylesheet" type="text/css"';
$this->getLayout()->getBlock('head')->addItem('link_rel', $path.$file, $param);
return parent::_prepareLayout();
Can this not just be done by using the <link> tag in head.phtml?

Change the position of a Stylesheet in a Joomla site

I have a joomla site. And I have a component installed which has it's own css file positioned in the actual component files, I would like to position this css file to another folder (not in component files), so I copied the css file to where I need to, and now I'm looking where in the code is written the PATH to the css file... and I found the code :
$this->addCSS('layout');
the file is called "layout.css".
How can I change this code to a path something like "/template/bluedilema/css/layout.css"
Somebody PLEASE help if you can.
Thanks
Have you tried:
$this->addCSS('./../template/bluedilema/css/layout.css');
Please note you have to adjust the path.
Hope this link will help you!
http://www.howtojoomla.net/how-tos/development/how-to-add-cssjavascript-to-your-joomla-extension

CSS root directory

I have a style sheet where I include background images.
background: url(../Images/myImage.png);
problem is, pages from different directories use this css!
My CSS files are in a CSS folder, images in an Image folder, and my html pages are in many different folders depending on their content and meaning to the website.
All my pages inherit this css as it is the MAIN theme.
The path used in the above example is a relative path. And obviously, this path only works for some of the pages. ALL i need is to link the images in the css from the ROOT folder. Therefore every path is correct no matter where the file is in the folder structure!
I have tried:
~/Images/myImage.png
./Images/myImage.png
/Images/myImage.png
Images/myImages.png
I don't think a root folder selector exists... but I hope it does :/
/Images/myImage.png
this has to be in root of your domain/subdomain
http://website.to/Images/myImage.png
and it will work
However, I think it would work like this, too
images
yourimage.png
styles
style.css
style.css:
body{
background: url(../images/yourimage.png);
}
click here for good explaination!
All you need to know about relative file paths:
Starting with "/" returns to the root directory and starts there
Starting with "../" moves one directory backward and starts there
Starting with "../../" moves two directories backward and starts there (and so on...)
To move forward, just start with the first subdirectory and keep moving forward
I use a relative path solution,
./../../../../../images/img.png
every ../ will take you one folder up towards the root. Hope this helps..
For example your directory is like this:
Desktop >
ProjectFolder >
index.html
css >
style.css
images >
img.png
You are at your style.css and you want to use img.png as a background-image, use this:
url("../images/img.png")
Works for me!
This problem that the "../" means step up (parent folder) link "../images/img.png" will not work because when you are using ajax like data passing to the web site from the server.
What you have to do is point the image location to root with "./" then the second folder (in this case the second folder is "images")
url("./images/img.png")
if you have folders like this
then you use url("./content/images/img.png"), remember your image will not visible in the editor window but when it passed to the browser using ajax it will display.
In the CSS all you have to do is put url(logical path to the image file)

Resources