Search

Hello all. Me again.

I am scratching my head about how to display image based content on my pages.

I have created a section with file upload set to image specifications (.png, .jpeg, .gif etc), however i cannot get the content to display properly using the xml:value-of tags.

Once again, sorry if i have missed anything, but as far as i can see the documentation only covers text based content...

I have tried wrapping the tags with img src which i am aware is probably not the way to go, but the content doesn't display when using the standalone tags with the relevant xml:template match tags either.

Basically, can anybody explain to me how to get image content to display this way? as i need my user to change images within a nivo slider.

If there is any documentation you think i may have missed then please link me! I hate to be a burden.

ok, so read the initial post...may have not been clear enough.

basically, i need to give my website a functionality to allow the owner to simply upload images into a nivo slider which will sit in home.xsl.

Im using the file upload field, although i am not sure if this will actually display images, but none of the xsl tags i use will display the photos, so how do i go about this?

The content in the XML only provides different info about the image, like filename and path, not complete markup but bits you need to put together the markup needed.

Something like this should work for a basic image insertion,

<img src="{$workspace}/{image/@path}/{image/filename}" alt="To make correct xhtml.." />

cool, how would i set it so that whenever my user uploads a photo into that specific content directory, it automatically adds to the list of images? like the content in the tutorial list?

forgive me for being uneducated, i am used to the workings of PHP and Perch CMS (great software) but i want to get my head around this. Simple things seem to be taking time for me to gain a grasp and there doesnt seem to be much out there in the way of tutorials.

Don't get what you mean?

If you add a file upload field to a section, the file will upload to the directory you specify when creating the section, and will be available in your XML.

Forgive me, i am getting rather frustrated because what i need is INCREDIBLY simple to understand, yet im not really sure how to ask for it.

Basically i need to create a way for webmasters to upload images, which will then be placed automatically into a nivo-slider on the home page.

I dont understand how to handle images. I cannot find anything documented on how to handle images and how to output the right xml and xsl for what i need and I dont understand half of the code snippets i see, as i try to use them and they never work. The code snippet you supplied me with successfully made the alt tag appear (eh!?) but no image.

Its annoying because i know it should be so simple.

Well, for starters, my example only works if your image is selectable as "image" from where you put the template.

You will have to compare the source it gives you and figure out whats missing / wrong for the image to load properly.

Symphony isn't really drag n drop & plug n play, you need to understand what you do... and thats what i like about it.

I'm a beginner too so i have not yet had to find out how to create a field that takes an unlimited number of images, which you will want for what you want to accomplish.

But you won't get very long until you understand how to pull out image data and display a singular image i think..

im really sorry to have sounded off key in my previous post.

Symphony is a really cool and very powerful CMS, its just i dont understand how things which are basically core functionality aren't actually documented anywhere....or at least aren't documented where i can find it (and i have VERY thick glasses...)

Is there any more in depth documentation about how to go around these things? :)

The "Hello" tutorials are good as starting points, and once you know how to pull out values and attributes from your XML, you'll be able to create image tags in your HTML with the appropriate src.

Regarding adding images to a slider, you can add a section called something like 'Slider images' which contains perhaps an upload field and a text input for the alt text.

You'd then create a data source which uses the above section.

You'd then create a page which has your new data source attached to it.

In the XSLT template you'd then create your img tags and accompanying HTML, and grab the path to the image src as @retypejonas described above.

Symphony won't give you a complete image tag - only the information that is entered into Sections by you or your authors (as well as default parameters). It's then up to you how you use this data on the frontend pages.

I did do the hello tutorials and i got a grasp on how to get content from x to y. It seemed straightforward and simple, but it was dealing with purely text.

The tag supplied for the image earlier doesnt work. I dont really know what i am meant to be editing within the tag (apart from the obvious directory path).

I am new to this, but hopefully i will get it soon.

One little helpful tip is to append ?debug to your page's URL

When you are logged in to the symphony backend adding this querystring to your 'frontend' pages (e.g. The Homepage) will show you all the XML Symphony is generating for you. This way you can quickly look up your images and see that Symphony returns an image node with various attributes such as filename and @path etcetera. This should help you generate an <img/> element with all needed info.

so i am right in assuming that there isnt a way of getting images to automatically render like you can get listed text content to do? as i dont want my client having to hard code in filename and path tags to their website when they want to change an image....sorry if i am being really dumb and missing something huge...

You are in fact missing something huge.

You need to "hard code" the image tag with the right variables.

  1. Add ?debug to your page url to verify that image info is included in the XML and what the xml-path and variable names.
  2. Add needed values (filename and path) in the right place in your .xsl template.

If you can manage to render text content XList item, the concept of render string Y and string Z inside the src-attribute of a img tag should not be too far out?

Edit: giving up editing now, this editor is a pain in the ass in Chrome.

Deciding how the HTML image tag is made up is down to you - this is done in the XSLT templates.

Your client would simply use the Images section in the backend to upload the images.

LIGHTBULB. crack open the champagne lads.

I used the XML ?debug to find the different paths i needed as davidhund suggested. The main problem was that i had not named the images content type "images", so after tinkering with the path and using the correct information i now have exactley what i am looking for (i need to test it with a nivo slider but i am holding out hope!)

thank you ever so much for being patient with me.

You are able to get images automatically render in your frontend. You have to make sure

  • to have a section with an upload field,
  • to have a datasource with the upload field selected
  • and to connect the datasource with the page(s) where you want the images to show.

The logic which images to show goes into the datasource. And in your template you have to create the img-tag and feed it with the values and parameters from the output of the image field in the XML. It's not just a value-of or copy-of like with text content, but slightly more complex as shown by @retypejonas in comment #3.

And looking at some of the ensembles (pre-configured Symphony installations) might help as well.

:)

crack open the champagne lads

I'm already on Desperados here - cheers! :-)

got it working with the nivo slider. i am now a very happy chappy indeed.

now for a stiff drink. thanks guys! :)

and by the way, no. im not an alcoholic ;)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details