Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
  
Image slider
HI

I have tried to put an image slider via css into Teamdesk . I can get the images in but they are stacked down the screen and i want three images across the screen darn it can't seem to get it to work
ID
1224
Category
Customization
Author

Accounts
Date Created
9/16/2018 2:42:48 AM
Date Updated
9/16/2018 2:25:06 PM
Comments
cooper collier  9/16/2018 8:22:09 AM
Where are you trying to put the CSS slider? On a form in xhtml or a view or a dashboard?

Post the code and I will take a quick look and see if I can find anything

Cooper
Accounts 9/16/2018 8:28:08 AM
I got it to work, however i don't want to store all my images in the resources would like to put the images that i already have in columns not sure how to do this

cooper collier  9/16/2018 8:44:24 AM
You can link to images in a record with xhtml code like this.
You extract the fid number from the URL of the form you are linking to.

Be careful with the syntax it gets confusing. You must have a trailing /

<img style="width:100%;" src="
<% If(IsNull([Employee Picture]),"no pic",
URLRoot()&"/attachment.aspx?fid=695938&guid="&Right([Employee Picture],";")&"&ext=.jpg")%> "
/>
Accounts 9/16/2018 10:12:29 AM
yep that is confusing me
cooper collier  9/16/2018 2:16:06 PM
It confused the heck out of me at first, this is a tricky thing.
In Fact it occurred to me, as I was finishing the below explanation, that this may not work for you.
I depends on how and where you are using the images.

I use the following code to display an image on a record view. I have people and equipment. If I was to go to my record I would see a small picture of me, next to my record details. (name, age, attractiveness scale) Similar to how the card view displays

The important thing is the image is not a static image, it is a different image/images for every record.

This would be awesome, if you had multiple pictures for a record, could be mug shots. Front/side/back in a slide show. Shopping cart, etc.

BUT.. If you are using static images in your slideshow and the reason you want them as a record attachment is to make them easier to update? IT NOT GOING TO WORK AS EXPECTED.

Why? Because every-time you upload an image the attachment ID changes, you would have to re-code your slide every time you changed images, it would be much easier to use resource section.

I am going to explain the code I sent you below for two reasons.
1. I sent the code and others may see it and be confused.
2. More importantly I wrote the whole thing already. Then realized it likely will not help you.

HERE WE GO..
This is for displaying an image attachment in a record Xhtml column.


Use the documentation to "suppliment" what I type here

https://www.teamdesk.net/help/13.3.aspx

go to the section near the bottom "User/Session Specific Functions"

I will break down the code really quick
(AT SECOND GLANCE I SEE I OVERLY COMPLICATED THE CODE I SENT, sorry, I will still explain the whole thing for anyone reading

This code needs to go into one of the places that accepts HTML.

We start with an image tag
The very basic of an image tag is.
<img src="path to image"> </i> or the self closing format
<img src="path to image" />

Make an HTML column and place this line of code into it

<img src="http://www.waterswebworks.com/bird.jpg" />

When you view the table records the new column should have a picture of a bird, that I place on a web server.

(You can place your images on a web server folder and connect to them with the above code)

I add the style="width:100%" to control the image size. Basic CSS.

NOW comes the complicated part.
We want to embed a picture from a record attachment, This is actually fairly complicated. It took quite a bit of trial and error, and help to get this correct.

We need to replace the src with the record path to do this we need to get out of HTML and into TEAMDESK mode, we do that by using the special tag <%= "teamdesk code" %>

Like this <img src=" <%= "teamdesk code" %> " />

TIP.. I always reformat this command to make it easier to understand
I start with. <img src=" " />

I then toss some line returns in
<img src="

" />

Now I know that the Teamdesk code I then add the <%= tag

<img src="
<%=

%>
" />

I save at this point, if I am able to save, I know I have the basic command correct, then I can concentrate on the teamdesk code.

We need to concatenate multiple commands/sections to get the correct path. To get this path do this.

View one of the records that has an image in it. Now right click on the image and view in new tab. Now copy the URL and paste it into a text editor for reference.

This is an example from one of my database. I AM CHANGING THE FID-ID SO IT WILL NOT LINK. But it is the exact code we need

https://www.teamdesk.net/secure/db/42540/attachment.aspx?fid=6959&guid=6292A633-FA69-4A44-AC2A-68FEB665E93F&ext=.jpg

NOTE, since I am inside the <%=%>, I need to surround the URL with "" so it becomes text..



<img src="
<%=
"
https://www.teamdesk.net/secure/db/42540/attachment.aspx?fid=6959318&guid=6292A633-FA69-4A44-AC2A-68FEB665E93F&ext=.jpg
"
%>
" />

The above code will display the image.
NOTE if you upload a new image it will change the guid portion, and it will no longer work.


Since I want the image from the record itself, I build the src= "" from the record information. I concantenate the parts together

https://www.teamdesk.net/secure/db/42540 comes from the command URLROOT()
"/attachment.aspx?fid=6959318&guid=" This is manually added text. fid is form ID and we get it manually from the URL
6292A633-FA69-4A44-AC2A-68FEB665E93F comes from command Right([Employee Picture],";"). The [] is a file column set to no revisions. If you have revisions, this will not work..
&ext=.jpg" this final bit we add as text. This limits us to .jpg images only. You can replace it with .png, so long as all the images are then .png. (it is possible to account for mixed file types, but its damned complicated)
We concatenate all the pieces together using &

NOW finally, I wrapped the URL in an IF statement. The idea was to display the words "no pic" if there was no attachment in the record. It does not actually work correctly as I entered it. What needs to be done is a blank placeholder image should be saved to the resources section, then replace "no pic" with the path to the placeholder image.

This is something I was supposed to do but forgot, and just realized its not finished.

the final code should look something like this

<img style="width:100%;" src="
<%
If(IsNull([Employee Picture]),
URLRoot()& "/res.aspx/blank.jpg",
URLRoot()&"/attachment.aspx?fid=6959318&guid="&Right([Employee Picture],";")&"&ext=.jpg"
)
%>
"/>

Hope this helps.

cooper
waterswebworks
Accounts 9/16/2018 2:25:06 PM
Wow thankyou, i will digest, being a newby it is all trial and error i am afraid but when i get it to work it is great.

I have a fine art database. It consists of Titles table, data table etc etc
Basically i have around 300 images in which are in the titles table. These are the images i want to put into a slider.

We have external users i.e. galleries who login to see what is available and would be nice for them not only to have a static display but a slider.

As this database has to be functional i.e. it keeps a record of every title and what is available in that title and what has been sold, printed, where it is and what exhibitions, books etc the title has been in. It is a balance between being functional and pleasing on the eye.

I have just started looking at CSS as well. Heaven help my brain

Thankyou i will look at and give it a go, might not be tonight though

Tina
Feedback
Back to Search Results