I want to display all images belong to a folder on front end using file module. I am new to pyro and I am only able to figure out how to display only one image.
`{{ base_url }}/large/image_name.jpg`
I will have one main images folder then may sub folders which will be having images. How to get all images belong to a folder in a loop?
You will need to iterate through the folders to create the image tags that you want.
Take a look at Files Plugin in the PyroCMS docs. The sample code has been provided there. You can handle conditions using tags as shown in PyroCMS Tags
Related
Let's say I visit a website named abc.xyz.
When I get to the website, I see the website runs a javascript script to create an interactive book. Obviously, the book must have image files for each page.
Now let's say I go to the developer tools tab and go to the sources tab to find the images - sure enough, I find them. However, the images come from a folder and domain named xyz.abc that displays a 403 error when accessed.
Is there a faster way of gathering these image files than visiting the links for every single image and individually saving every single image (Bare in mind the images themselves are not restricted access)?
Real World Example:
Image showing files under the sources tab.
In the image above, you can see there are several image files located in a folder (hundreds, in fact). The domain and folder the images reside in display 403 errors when accessed, however the images themselves are not restricted. To download the images, you can individually get the link to each image and use "Save image as". However, this will be time-consuming for hundreds of images - is there a faster way to download all the images?
Edit: Furthermore, would there be a way to quickly order PDF images via a pre-existing page number on the PDF file.
To get images of a webpage , you can use python script to fetch all the image src which later u can perform any operations on it , such as copy it to your system or into your website .
I've used BeautifulSoup for webscraping
from bs4 import BeautifulSoup
import requests
page = requests.get("https://stackoverflow.com/questions/63939080/is-there-a-fast-way-of-gathering-image-files-from-external-sources-chrome-devel")
soup = BeautifulSoup(page.content, 'html.parser')
#print(soup.prettify())
for element in soup.find_all("img"):
try:
print(element['src'])
except Exception as e:
pass
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!
I want to modify template for News Feed so it looks better.
I'm unable to find Which folder/folders is/are used to Create News feed IN PHPFOX since it contains almost 7000 files.
Can any one help me in finding folder/folders for NewsFeed Template? This will very-2 appreciated.
I'm using PHPFOX v 3.7.2.
These folders FILE, INCLUDE, INSTALL, MODULE, STATIC, THEME are there.
Which one is used and inside this folder which folder is used.
The path is: \www\yourfoldername\module\feed\
Inside this folder are the files that are needed for the news feeds for editing.
I've installed a new Magento Store and just pasted a media directory from another Magento Store. But when I try to insert images to some page or product using the WYSIWYG editor, I can upload new images and create new directories, but the images and directories that were copied does not appears.
What do I have to do to programmatically add this images and directories copied to the list of the "Magento's media browser"?
Below follows an image in case I didn't make this question clear enough. (You may notice some white squares, I just made a quick edit in this picture to hide the directories and images, as I can't show them)
We currently downloaded a Wordpress template from Themeforest called Gaia. It is a portfolio theme that allows you to upload portfolio items, and uses the featured posts section for the thumbnails on the main portfolio page. I have currently uploaded it on a subfolder of the website "/wordpress/".
Our problem is, whenever we upload a picture using the upload tool of the featured posts section, it formats the SRC of the uploaded image as:
http://www.sitename.com/wordpress/http://www.sitename.com/wordpress/wp-content/themes/gaia/images/thumbnail.jpg
I have no idea why it includes the URL of the theme folder twice before the URL of the image file. Was wondering if anyone has had a similar problem that can point me to the direction of a solution.
Thank You in advance!
Seedorf.
well.. I guess its a bug then.