How to get path to sites DIR like i have sites/www.example.com i need to obtain this path inside a .tpl file of module, i tried drupal_get_path('theme','my_theme') and path_to_theme() but both of them point to the module DIR. any method that i can use to obtain path to my sites/example.com folder ?
Maybe the conf_path() will help you.
The question is, why do you need your sites/[site] directory?
maybe there's something misguided in your .tpl file. the drupal_get_path() should be sufficient.
Related
I have set up a Typo3 project and I am using the Bootstrap Kickstart Package extension. So far everything works, but for example the CSS files are not loaded (see screenshot). If I call the paths in Explorer, all files are available. Can someone here help me?
Do you use the .htaccess of TYPO3? You can find it in the typo3_src folder and move it to your root directory. Without it, the timestamps of the files ?12345 will be interpreted wrong.
Seems it could not get a proper path to the assets. Please check your baseUrl and absRefPrefix
in the setup ts. Check property below:
config.baseURL = http://localhost/project/
config.absRefPrefix = project/
Generally, absRefPrefix required in the local server it does not require at the live server.
Second possibility permission issue, please check directory permission.
Hope this helps you!
Greetings!
I'm having some trouble finding my /mysite/ folder - I'm trying to edit my _config.php file so I can add some schema to a website however, there is no /mysite/ folder. Is it possible it was renamed something else, or simply doesn't exist? Is there a way I can find out which folder is the "/mysite/" folder?
The global variable $project is defined with the name of the "mysite" folder (it's basically the project folder).
So echoing that out from ContentController::init() would be a good way to determine it. Otherwise, just search the folders for "Page_Controller" and you should find the page class and where all the other work is stored.
global $project;
var_dump($project);
die;
It should be in your webroot, where also a /framework/ and a /cms/ folder should be. Look at the webserver configuration to find out where the root of your website is located.
How did you install silverstripe? Did you use composer? Did you download a ready-to-use zip? If yes, which one?
I start with Drupal and I have read some of topics about my problem but I didn't found the solution.
My problem is the following :
On my website (for the moment in localhost) I use Clean URLS module. The problem is when I enable this module and when I use the relative path of my files, my pictures or links don't work.
For example : src="./sites/default/files/styles/large/public/add_tool_version.png".My pictures are not visibles.. I don't know why this module doesn't work with the relative path.
But when I disable the module, the link is works fine.
Please, can an you help me ? Do you have any solution to fix it ?
Thanks in advance for your answers
Try using absolute paths. In you case with image it would be like:
src="/sites/default/files/styles/large/public/add_tool_version.png", without dot.
This absolute path will always refers to that image instead of relative path - it depends on you current directory or page.
The problem with clean urls is the way browsers read urls and interpret them as directions in a file directory. Lets say you are at http://www.example.com/?q=node/11, or, with clean urls enabled, at http://www.example.com/node/11.
When enabeling clean urls, and putting a link with a source into some node, your browser will search for your files in the folder that is specified in your url. Thus, when you declare the source to be sites/default/files/styles/large/public/add_tool_version.png and are on the url http://www.example.com/node/11, then the browser will look for the file in the directory node/11/sites/default/files/styles/large/public/. Usually this would work, but in drupal, there actually is no such folder. All drupal pages are just versions of the index.php in your base-directory. In drupal, the url doesn't have anything to do with file structure - unfortunately, the average browser doesn't know that.
Without clean urls, however, your browser will recognize the url as a combination of a base path (www.example.com) and a query (?q=node/11). It will therefore look for your file starting from the directory specified in your base path.
If you still want to have your relative paths working with clean urls enabled, you can use the function base_path() in front of your actual source.
I have set up 2 drupal instances pointing 2 codebase with a common database
www.abc.com points to folder /var/www/abcfolder
mywww.abc.com points to folder /var/www/mywwwabcfolder
The content is uploaded via mywww.abc.com and www.abc.com is used for general viewing. I have used domain access module where mywww.abc.com is an alais to mywww.abc.com
I want that all the files that are uploaded should be maintained in a common folder i.e. in /var/abcfolder/public/sites/all/files for both urls
I tried changing the file system path via admin/file-system to ../../abcfolder/public/sites/default/files since the path should be relative to the drupal installation folder. However on uploading a file, I get a file not found error.
Any help to resolve this issue would be appreciated?
Should I change the htaccess file in any one of the codebase? If yes, what should the change be?
Regards,
Loveleen
How about trying this:
Store the files in /var/www/abcfolder/sites/default/files. Create a symbolic link from /var/www/mywwwabcfolder/sites/default/files to /var/www/abcfolder/sites/default/files
Look up symbolic links in linux if you don't know what they are. If you're using windows you can still do symbolic links but they are more complicated.
[BTW I am not sure why you are doing this complicated setup. Reconsider using domain access unless you really need to. Is it necessary to have two sites like this? ]
I'm trying to configure my Gallery2 integration in Drupal but i'm stuck at Step 4.
I have to put in two path's to drupal's .htaccess file.
The public path (This is the location of your Drupal .htaccess file relative to your webserver document root.)
Filesystem path (This is the absolute directory path of your Drupal .htaccess file.)
but i have no idea what i have to put where?
My site sits in public_html/5.0, is this the public path?
From manual:
"You may also decide to skip this step in case you dont want/need short URLs for your embedded gallery."
Usually .htaccess for drupal is located where you unpack "drupal....tar.gz".
Try an empty field or ".".
For absolute directory path enter the document root (public_html or public_html/5.0) and execute "pwd" command. You'll receive something like /home/user1/public_html/5.0
This is your absolute path.