Search the Community
Showing results for tags 'body'.
Found 3 results
Xonox posted a topic in API & TemplatesHi, I need to add the original image dimensions (width x height) for the images inserted in the body field, in a few data-fields. Something like: <a href="/site/assets/files/1092/image-1.jpg"> <img alt="" src="/site/assets/files/1092/image-1.690x0-is.jpg" width="690" data-width="1500" data-height="1000 "> </a> Where data-width and data-height are the image-1.jpg dimensions. I tried to do this through a file, to control the field output: templates/fields/post/body.php But turns out the body comes already formatted from the DB, so I can't override the image display, unless I use some cumbersome str_replaces. Even with this solution, it's impossible to achieve the desired result. Is there any way I can do this through a ProcessWire process? I know it can be done through php, reading the file's header to extract the height and width and then do a str_replace on the body string to insert the desired code. However I'm curious if it can be done in any simpler and more effective way, without having to read the files from disk and do the replaces. Thanks,
Hello, Just starting. I've tried to look to the files head.inc and foot.inc. I'm trying to find the way to assign text from CMS to the html. I already have applied this as a template and it works. I have the images working and all links working. In this website there are several different parts which I need to put text which can be transformed with PW. I need to do: Intro News About me Booking info Contact Therefore, as you can see there will be several independent text boxes. My html/css is a horizontal layout so everything is one one file index.php. Each div is a section. I think this is quite easy so please let me know... Thank you.