Jump to content

If statement to a specific format file?


This topic is 8430 days old. Please don't post here. Open a new topic instead.

Recommended Posts

OK Im new to CDML and learning as I go but im stuck right now. Heres my problem.

I Have various "categories" of products each has its own "details.htm" format file since each product has different specs and such. I need my default "results.htm" page to be able to take me to any of my detals.htm pages based on what my product desription field equals. Can I do this with an if statement or am I lost?

EXAMPLE

<A HREF="[FMP-linkrecid: layout=web]

[FMP-If: Field: Product .Eq. truck]

[WHAT GOES HERE? SO I GO TO THIS FILE -- truckdetail.htm]

[FMP-ElseIf: Field: Product .Eq. car]

[WHAT GOES HERE? SO I GO TO THIS FILE -- cardetail.htm]

[FMP-ElseIf: Field: product .Eq. oil]

[WHAT GOES HERE? SO I GO TO THIS FILE --oildetail.htm]

[/FMP-If]">Click For More Details</A>

Link to comment
Share on other sites

U can do this way.

In the results page try to display all the products with hyperlinks.and the if u click on any product a popup wiondow comes up with complete details of that product.

does it makes sense?

To be clear....

The way u r trying to do is troublesome. For each and every product u have to write a line of code. What if u have 100 types of products.SO what i suggest is try to disply all the products with hyper links in results.html, by clicking on particular product the details.html page should popup with details of that product.

I can help u, if u like this way.

good luck

sree

[ June 13, 2001: Message edited by: bhavanams ]

Link to comment
Share on other sites

UH ok hows that tell FM to display the correct detail format page?

The results page is displaying the correct info, I just want a link to go to the correct detail format file. ie if its a car then it should go to the cardeatil.htm format file if its a van it should go to the vandetail.htm format file and so on.

I have my results page displying the correct information

Link to comment
Share on other sites

OK to descriminate whether the record is car or van the easiest way is to add a field to your database with car or van in it. lets call it VehicleType. Its hard for you to determine whether a Merc SLK is a car or van by the name Merc SLK.

you can then add the replacement tag [FMP-Field: 'VehicleType'] to your anchor

eg <a href="etc etc&-Lay=[Field: 'VehicleType']detail.html&etc etc etc>Detail</a>

so when you get to the list format file WC will replace the tags with the values from the field VehicleType for each record the client has found. You'll end up with

for car

<a href="etc etc etc&-Lay=cardetail.html&etc etc

for van

<a href="etc etc etc&-Lay=vandetail.html&etc etc

You can use if statements but they would be best used on a single detail page to do a whole-sale change of HTML/CDML (like having two format files in one. The database/WC will still have to decide if the part is for van or car!

hope this makes it a bit clearer

laugh.gif" border="0

Link to comment
Share on other sites

Err uh I dont think that will work for what I need I. OK on my Search page I have a list of all the categories that are href links to that categories results page like carresults.htm , truck , vans... that then show a list of results... each result links to that categories details format page.

I also have a section on my search page where someone can search by manufacturer like say "Chevy" it finds all the chevy's and goes to this default results page that shows a list of all the Chevy's but some may be truck vans or cars. from this default results page I then want to go tot the correct car,van,truck format page.

Am I making sense?

Link to comment
Share on other sites

ok heres my search page

its split in half

Left side:

Cars ---(each of these is a FM CGI link to find the word Cars in my product field that then goes to my carsresults.htm format page)

Truck

Vans

This side works fine

Right Side:

Search By ??? (FM Field) Manufacturer

pop down with "equals,contains" and the entry field

Search button

This then does a search on the field Manufacturer and goes to my defaultresults.htm page.

the default results page then shows a sorted list of th first 10 things found. like

1969 Chevy Camaro click to view detail

1992 Chevy Clazer click to view detail

1994 Chevy Astro click to view detail

I wan the user to then be able to click the text link "click to view detail" and then it go to the vandetail.htm format page or which ever format page is relevant Since my cardetail.htm page is different than my vandetail.htm format page

Link to comment
Share on other sites

Okay, if u r able to disply results in defaultresults.html then

in the defaultresults.html

write a line of code like this.

<A href="#null" onclick="window.open('[FMP-LinkRecID:]&-format=details.html', '[FMP-CurrentRecID]','toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=800,height=650,top=0,left=0' )" >[FMP-FIELD: Fieldname u wantto display]</a>

hope this works for u.

Link to comment
Share on other sites

If you only have say 2 format files with a different design to each (eg cars and vans then you could quite easily use FMP-If statements but it might be easier to have a field in each record on your database to say car or van and then use a replacement tag in your a href

eg

for car or van

A href="FMP..........&-Lay=[FMP-Field: 'VehicleType'].html&etc..etc>More Detail</a>

where the field VehicleType contains the vehicle type (obviously!?! smile.gif" border="0 )

You also then name your format file accordingly.

hope this is of some help.......

laugh.gif" border="0

Link to comment
Share on other sites

This topic is 8430 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.