in my Drupal site
http://www.revdup.co.uk
I recently changed the domain name, I had to change a few absolute URLs and everything seems to be working fine now, except the front page, and only when I am logged in, not as a guest..
for some reason all the theme images (such as those used to build blocks appearance) are using an incorrect version of the base URL eg:
revdup.co.uk/revdup/themes/drupal_pwc010_tech/images/Block-s.png
instead of:
revdup.co.uk/themes/drupal_pwc010_tech/images/Block-s.png
I have changed the base URL variable in settings.php
Why is this only happening on one page and how can I fix it?
You'll need to explicitly clean the template cache. Go to Administrator->Themes->Selected theme->configure->Save.
This will regenerate the template cache with correct urls. Also clear the drupal cache in Admin/settings/performance.
Related
My site, Jekyll static pages and a blog, https://omnebonum.github.io/dsu/ on GitHub pages looks like it is supposed to (such as it is). I have a custom URL set up that points the repo to democracystraightup.org. That works but when I go that URL the pages show up without any CSS or pics.
I know this isn't super specific information, but you can check them both out if you like, and any general insights would be appreciated.
All your css, javascript and other assets are returning 404 errors:
The paths are all pointing to subdirectories of http://democracystraightup.org/dsu/ (e.g. http://democracystraightup.org/dsu/js/gallery.js).
Thats wrong.
You need to drop the /dsu to make it work.
For example http://democracystraightup.org/js/gallery.js works totally fine.
So, in the WordPress page, I need to link the pdf in wp-contents so I linked it with the relative URL as href="/wp-content/uploads/2017/03/test.pdf"
when I click it since my root in localhost is localhost/test it takes me to localhost/wp-content/uploads/2017/03/test.pdf (which doesn't serve the file). However, I don't think it'll be an issue in the server. Still, I want to know if this is the correct way?
Also, so I'm in page localhost/test/page22 Now on the page, I have an anchor tag as href="/page23" it takes me to page23 correctly, but when I'm in a different sub page say localhost/test/page/page2 now, the link takes me to localhost/test/page/page23 which is not correct as it should be localhost/test/page23. How can I solve these issues
WordPress provides functions for getting the URL of resources you should use these instead of having your code generate the URL. In this case you should call wp_get_attachment_url().
I turned on URL rewriting on Drupal, and some URL image are broken.
For example :
local/tw/sites/all/themes/tw/images/1-p1.jpg become
local/tw/content/sites/all/themes/tw/images/1-p1.jpg
or
local/tw/sites/all/themes/tw/images/2-p1.jpg become
local/tw/node/sites/all/themes/tw/images/2-p1.jpg
Any ideas?
If you used relative path, and you're talking about contents within nodes, it's perfectly normal, since "node/" is interpreted like a directory.
You could fix this problem adding a "/" before image src, or using module like Path Filter that provides a simple file:relative/path/to/file syntax.
I'm developing a site locally using xampp. The path the images are using is
/devsite/sites/default/files/icon_facebook.jpg
When I check out of the site on my server the path remains the same for the images, even though the image is now at
/~devsite/sites/default/files/icon_facebook.jpg
Are the image URLs just hard-coded by the wysiwyg including the wrong base path? Is there something I can do to make them work?
When you're using wysiwyg, the image path is saved along with the rest of the HTML, and the filters don't convert it. So under some conditions - especially if you're moving from a subdirectory to the HTML root - you'll have images that are misplaced.
The pathologic module might be of some help here. Otherwise you could use Views Bulk Operations to do a string_replace() operation your HTML fields.
Try setting the $base_url in sites/default/settings.php. I'm not sure how the WYSIWYG is setting images, but it's pretty standard that it should be using a path relative to the base url.
On certain pages drupal_get_path isn't working correctly (or it is and I've got the wrong function)
The base path is wrong
Example:
Image is supposed to be at
http://domain.com/sites/all/modules/pecapture/images/headline_dontmissout.jpg
But when on
http://domain.com/node/9
The URL is
http://domain.com/node/sites/all/modules/pecapture/images/headline_dontmissout.jpg
The same happens on the page
http://domain.com/admin/build/ and block edit page
How do I get the right path?
added base_path() to beginning of my paths...
base_path (http://api.drupal.org/api/base_path), if you use php code.
In html case, just add "/", like: /sites/all/modules/pecapture/images/headline_dontmissout.jpg
One problem: if you work on subfolder (Drupal installed in internal folder of main site): http://domain.com/subfoldersite, it will not correct, becase will remove "subfoldersite".