ExpressionEngine images/fonts missing from subtemplates (template in template group) - image

I have set up a site with ExpressionEngine, and put the fonts and images folder in the root of the site, and they work absolutely fine for pages that are template group home pages (with the house icon) but they suddenly dont work on pages that are added to the same template group as new templates...
the paths look like this in the html:
href="fonts/Anybody.woff2" or url(img/header_stripes_light.svg)
where should I copy the fonts and images folders to make them also work in subtemplates? I couldn't find anything useful in their documentation about this issue.

That's an easy one! make those url's absolute and you're fine.
Do it like this: href="/fonts/Anybody.woff2" or url(/img/header_stripes_light.svg)
Your paths are relative to the page now, so without the initial "/"

Related

Home layout missing in _layouts folder, but works

I started to make my blog with jekyll and github pages.
I was doing fine with the basic theme,
But I wanted to apply the side bar property,
so I downloaded the theme which has the sidebar, from https://idratherbewriting.com/documentation-theme-jekyll/
So I downloaded the proejct and overrided.
I don't know much about how this works,
but the strangest thing is that
in index.md file
if I put
---
layout:home
sidebar:mydoc_sidebar
----
it happens to show the basic theme layout
and the posts as it should be, but if I change the layout to
something else which is inside the _layout folder such as post, default,
the posts disappear and I have no idea why Jekyll does this.
Even when I erase the layout, it returns empty screen
so I'm sure it's doing something with the
home layout but I couldn't find anywhere how the home layout is rendered.
In _config.yml, we can see that you are using (theme: minima) the minima gem based theme (documentation). That means that by default, all your _includes, _layouts and assets are hidden somewhere on you computer. You can use the bundle show minima command to find out where they are stored.
As home layout exists in minima theme, is it used.
If you want to use your own home layout you can copy it from minima to your _layouts folder and modify it to suits your needs.
cd your/root
cp `echo "$(bundle show minima)/_layouts/home.html" _layouts/home.html`
If you want to be sure not to use hidden resources, you can delete the theme: minima directive from your _config.yml file.
this issue can be caused by several factors but it is possible there's no issue at all :)
1) Stop Jekyll serve/watch.
2) Delete the _site directory.
3) Rebuild and serve the site
jekyll serve.
Keep an eye on the terminal to see if Jekyll warns you about the missing layout file.
It is possible, albeit unlikely that the theme or a plugin id building layouts on the fly. To override this (whether it is the case or not), create a home layout as usual and include in a page/post's front-matter. Just keep the layout basic with something like a red background so that you can easily test if it is loaded or not.
I think deleting the _site folder will fix this but if not, try the other option and let me know.

Hugo: adding more pages to single-page themes

Hugo is a general purpose website framework and a static site generator. However, most of the themes are single page themes.
Is it possible to add more pages to these single-page themes in Hugo?
I am specifically interested in the Dimension theme.
Thank you very much for your help.
This depends on how the theme is constructed. In Dimension's case, the answer is no - you can add new markdown files to your content folder, but they will only be rendered on the index page, not as their own individual pages. If you want to generate multiple pages, you will have to either edit the theme or choose a new theme that supports multiple pages.
To edit the theme, see the docs on customising a theme and creating a theme. You will also need to know Hugo templates, so the go template primer is an essential read. Editing themes can be a little tricky, but if you have worked with other templating languages then it is not too much different.
In your case, you will want to edit layouts/_default/single.html to create a single-page view for all of your markdown files. You will also need to edit layouts/index.html to link to them from the index page, otherwise no-one will find them.
Hugo is not just a general purpose website framework/generator. I have been using it for article publishing, news website and to generate a blog! Most of the themes are single pages because people created themes in the way they love. Although still in development, you can check my website Desktop Luxury that is fully static and built with hugo. It's super fast, supports AMP and users just love it. They can't tell the difference between Wordpress sites and Desktopluxury.com in terms of look. Note: The difference is clearly visible in terms of load time, speed and customization ability!
Although it varies by theme, you can easily create a .md (file that contains content - similar to .html*) file out of your blog folder. For example, you want to create an About page. In the root folder that contains your hugo files, create a directory root/content/blog. Add permalinks to your config file that tells the theme to categorize files present in /root/content/blog folder as the blog files. Create the pages such as an about.md & contact.md in root/content folder. They won't show in the blog list, however, they'll be rendered and accessed by siteurl.xyz/about or siteurl.xyz/contact.
*I said .md file similar to .html file as the OP seems new to webdevelopment.
EDIT:
Final homepage after adding few posts
I just downloaded the theme mentioned in the question, added few .md files by opening CMD in the root directory of Hugo website folder and running command ~~ $ hugo new professional.md ~~
Created various pages and added content in them just like we write articles. I achieved the result you wanted with no issue at all. It was super easy!

joomla prepends to 'path'

my wife have a joomla 2.5 site
She claims that she has done nothing except, installing and and subsequently uninstalling Koowa plugi, Ninja plugin and Ninjaboard component.
Anyway after that the joomla 'path' have changed such that between the domain name and the path rendered by HTML, the joomla server now seems to insert "/index.php" or "/index.php/menu-item-name"
for example clicking a link like the following:
<a href="images/some_folder/xxx.JPG">
points to something like: http://www.domain.contry/index.php/fun/images/some_folder/xxx.JPG
how to we change the 'global path settings' such that
<a href="images/some_folder/xxx.JPG">
points to
http://www.domain.contry/images/some_folder/xxx.JPG
NB: my joomla and php skills are very basic :)
Update:
I think the problem something like this:
all the image paths used to be 'absolute' and are now relative, so if I am in 'index.php/some-menu' and click 'images/xxx.jpg' then it resolves to 'index.php/some-menu/images/xxx.jpg', she has all her images in the image folder, is there some way make all image paths 'absolute' instead of relative in joomla?
because changing 'images/xxx.jpg' to '/images/xxx.jpg' with firebug fixes the problem...
if it is not possible in joomla... how bad do you think it is to:
download the sql database
and run a regex akin to
s/<.+?=\"(images)\/[\w\s]+?\.[\w\d]+)\".*?>/\/$1/g
Look in your global configuration under the Site tab for your SEO settings. Make sure you have URL rewriting enabled, and follow the directions in the tooltip to rename htaccess.txt (Linux servers) or web.config.txt (Windows servers) if necessary.
If you get a server error on the site at this point, try uncommenting RewriteBase / in .htaccess.

#font-face stopped working in firefox

edited again to say NEVERMIND because problem is no longer occurring(?)
EDITED TO ADD LINKS
my site:
http://www.mainstreetmassage.co/index.html - relative path to stylesheet
http://www.mainstreetmassage.co/index2.html - absolute path to stylesheet
copy site on same host account:
http://
www.mcdanielcounseling.com/index.html
this "copy site" is the site that got changed last night by deleting just the html and css for the blue ribbon that had the custom fonts inside it - but the actual font files are still in the "copy site"'s css folder
The 2 sites are in 2 separate folders and don't share any resources.
END OF EDIT
2 custom fonts used to work fine no matter what browser. I had a little trouble initially getting FF to work but sorted that a while ago by putting the font files "loose" in the css folder, not in a folder of their own, and it's worked fine since then.
All the links I made absolute, because that seemed to make the page faster, but that too was a while ago and no trouble until this morning.
The only thing I can think of that's changed is, I set up a second site on same hosting account or server, it was at first just a copy and paste of my site but I've been slowly changing it for the owner, and last night, in that site's folder only, I deleted not the custom font files, but just the references to them in the CSS file, plus the HTML element that used them - but only in the 2nd site, not mine.
Then all of the sudden today the fonts are not displaying in FF at all, on my site. I fixed it sort of by following another answer on here that suggested making the urls relative for the css, and that worked, but I am wondering what made it happen and if I need a more permanent fix.
Thank you

Organizing folders and sub-folders in htdocs

I'm using windows 7 (64 bit).
If I place a site (index.php, other docs and other sub folders [css, js, imgs etc]
directly inside the htdocs folder (amongst the XAMPP folders)
and view the site through localhost there is no problem.
If instead the site is placed in a subfolder of htdocs, C:xampp/htdocs/mysite,
and I try to view index.php all links (relative) to subfolders (eg images, css and js etc) stop working.
I obviously would prefer to use xampp for more than one site, so i want to have a sub folder in htdocs for each site.
Believe me I've been googling and I've looked at some 'solutions' (for example changing the httpd.conf for example, would mean changing it each time i want to view a different site....) but nothing has helped. What things should I be checking out?
Edits
LINKS FORMATTING
href="/css/homeAreaStyle111.css"
data="/svg/linkedbutton.svg"
Are you preceeding your links with a slash? Ie
<a href=/page.htm>
If so those links will be pointing to the site root. Try replacing with ex
<a href=page.htm>
or
<a href=./page.htm>
In case you have your website at C:xampp/htdocs/mysite then your links will look like:
href="/mysite/css/homeAreaStyle111.css"
data="/mysite/svg/linkedbutton.svg"

Resources