Search

So after reading alot of the documentation and messing around for a bit today i started to think of one of the ways i could use this.

I was thinking about show casing images. So i made a page named images and then stopped.

i started to plan this thing out. I was thinking if i could make a Utility or data source that could get the images i uploaded in the image section to just display the images in a grid style using CSS on a page?

is this possible and hard at all?

thanks for all the help

Well so far i got as far as the pgae reads “Images No recrods found.”

so i might say so myself it seems i could be on the right track..but still need some work

I was thinking if i could make a Utility or data source that could get the images i uploaded in the image section to just display the images in a grid style using CSS on a page?

Yes, you must use a Data Source to get all entries from your section. Also you can use an Utility to show all entries on page, you decide.

Be sure to use parameter ?debug for debugging. (Example, http://localhost/page/?debug)

yes…i got lots to learn. Thanks for the input

ill keep ya posted if i get it to work

So i have been working on this image showcase and i am coming into some trouble.

I got the data source and the section and the entry is showing up in the page. I can also grab the title of the image but i can not grab the image itself. In the debug window there is no path. I also tried to do a select of the image but it doesnt work.

<images>
    <section id="9" handle="my-images">My Images</section>
    <entry id="23">
        <title handle="test">Test</title>
        <image size="18 kb" path="" type="image/jpeg">
            <filename>37200945503PMchessboard-illusion.jpg</filename>
            <meta creation="2009-11-17T11:29:36-05:00" width="505" height="400" />
        </image>
    </entry>
</images>

that is the the XML code in the page. Anyone have an idea how to get the image to display on the page?

Thanks

  • What field type are you using for the “Image” field — the native File Upload field?
  • What Destination Folder are you saving the images into?

If you’re using the native File Upload field, could you look into your database directly for the sym_fields_upload table and see what is in there. Is there anything in the destination column for any rows?

Yes, there is info in the rows Type, Collation. That is all that i can see

Are you using the native File Upload field, or a custom upload field (via an extension)?

If the former, your sym_fields_upload table should have four columns when you view its data: id, field_id, destination and validator. Sounds to me like the desintation column doesn’t have the value set.

I am using the native uploader. And i do see the id, field_id, destination and validator.

Thanks nick

Well i got it to work. I just had the images uploading to a different folder then i thought haha. Now i have a quick question. I am still learning how to do this XSTL thing so when i wrote my code out i wrote mine like this.

<img src="{$workspace}/images/{image/filename}"/>

This works but when i looked at the the get-images that came with the default symphony i saw this.

<img title="{title}">
        <xsl:attribute name="src">
            <xsl:value-of select="$root"/>
            <xsl:text>/workspace/images/</xsl:text>
            <xsl:value-of select="image/filename"/>
        </xsl:attribute>
    </img>

I was wondering what is the main difference? Which is better? I can see how both work and get results but i am just not sure the “correct” way.

Thanks

Both are equally “correct” :-)

It could also be written as:

<img src="{concat($root, '/workspace/images/', image/filename)}"/>

The default workspace of Symphony is primarily a training too, so I imagine Allen was simply illustrating two different ways of adding attributes and their values to an element.

As Nick said, both are correct. The use of curly braces in an attribute is just a shorthand way of writing the full thing.

There were points in the default template that I use different methods precisely illustrate that there are two ways to the same problem. There are some situations where writing the full thing instead of using the curly brace short hand–called, AVT (Attribute Value Templates)–is useful.

For example, you cannot write conditional statements like xsl:choose or xsl:if inside an AVT.

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