Search the Community
Showing results for tags 'media management'.
-
I've been reading through the forums for best practices on handling images on static pages - that's to say, how best to handle images in my static html markup when I don't have any need for image fields. On my current site, I have a lot of images on the home page and it seems silly creating an image field for all of these. Also, for pages where I do have image fields, I've been using the PageImageSource module to create wepb srcsets automatically (and it works great). I like setting my desired image sizes for the srcsets in one place, so I'd like to use this module for everything everywhere if possible. The problem is that it only works with PageImage objects, so I have to do something with my static images in order for the plugin to work with those. It looks like the media manager modules are not maintained. Could I just somehow put all my non-image field images in one page reference or something and have the PageImageSource module render those wherever they're needed? Could the following work? 1) Create an images/media page and template with images field. Set it to hidden. 2) // In _init.php: $media = $pages->get("template=media", include=hidden); 3) // on a template page markup: $desiredImage = $media->images->get("name=imageName.jpg"); .... <div><=?php $desiredImage->render()?></div> // renders the srcsets and <picture> tags with the PageImageSource module I don't know if this is the recommended way of dealing with <picture> tags for static pages (srcsets are such a pain to do manually!). Maybe there are some downsides to this that I'm not aware of. Any guidance would be very welcome.
- 1 reply
-
- images
- image library
-
(and 3 more)
Tagged with:
-
Beware… Newbie Question! Have checked forums first but couldn’t find exact answer. I have a use case where Customer loves to store images in folder structure. If I adapt this in PW, it can be pretty cool as I can add a lot of rich detail onto each Page in the folders that store images. For example.. —Country — Zambia — Zimbabwe On each country page exists Imagefield, plus a few text fields for copyright, tags and mapMarker for geolocation data. When a user drops a batch of 20 or so images onto the country page, they can add “global“ tags, location, copyright data for these images in one go. If they need fine grained data on a per image basis, then I am looking at a cool little module for extending Imagefield….. https://github.com/justb3a/processwire-imageextra So part one is looking good Part two of the eternal problem is how to get images copied off of one page onto another page in the CMS. Preferably as a copied image, not a linked image because the file tree described above holds the master image repository for the website, plus also future web sites or use cases as well. So I imagine an extension of the image field where I replace the File Upload button with another dialogue allowing me to cherry pick images out of the folder structure in Part 1. Is this possible ? Looking at the code around lines 1586, 1544 for function TraverseFiles(files) in InputfieldImage.js would it be possible to send in an alternate file collection cherry picked via a dialogue & jquery from the pages in the image repository tree into this function ? Then I can take full advantage of all the existing neat code in here ? It would be so crazy to try and re-invent the wheel as existing code looks so rock solid and cool. Many thanks for reading!
- 3 replies
-
- media management
- select image from a page
-
(and 1 more)
Tagged with: