Results 1 to 8 of 8
  1. #1
    Newbie
    Join Date
    September 4th, 2009
    Posts
    10
    Simple WebMerge Question About Fields
    I have a question... Is it possible to return a field result in a template and use it, but if the result is more than X number of characters trim it?

    Like lets says Field_001 returns "Here are the field contents", but I only want the first 15 characters, so I really only want this printed... "Here are the fi"

    Possible?

    Also, how to do something similar in regards to creating on-the-fly filenames (switch whitespace to web-friendly elements such as - and so forth).

    Thanks in advance.

  2. #2
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    Check out the maxlen attribute for the WM-Field tag in v2.5:

    Added a new maxLen attribute for the WM-Field tag to truncate text from a specified field to a given length. Text is truncated on word boundaries to preserve readability, and any trunacted text is indicate with the addition of an ellipsis at the end if it. This option can be useful when you want to display a portion of things like long product descriptions.

    http://www.fourthworld.com/products/.../download.html
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  3. #3
    Newbie
    Join Date
    September 4th, 2009
    Posts
    10
    Quote Originally Posted by FourthWorld
    Check out the maxlen attribute for the WM-Field tag in v2.5:

    Added a new maxLen attribute for the WM-Field tag to truncate text from a specified field to a given length. Text is truncated on word boundaries to preserve readability, and any trunacted text is indicate with the addition of an ellipsis at the end if it. This option can be useful when you want to display a portion of things like long product descriptions.

    http://www.fourthworld.com/products/.../download.html
    Yeah... that's what I was looking for. Excellent feature to include. I also figured out how to replace to non-web-friendly characters using regex and bbedit in a click of a button.

    I do have another question though... although it does represent a completely different issue. (as you can see I'm still learning this program).

    OK, I have a database and I have records in it that I would like to display.

    However, normally you would display a set of data from one record line. In my case though, I sometimes have 6 or 7 records (with different data) that I would like exported to the same detail page. How can I accomplish this?

    Example

    Normal: Record data 1, 2, 3... select and display fields from 1 on a page, 2 on a page 3 on a page.

    My case: Record data 1, 2, 3... select and display fields from record 1 and 2 on same page (based on certain field being the same), display data from record 2 onto a separate page.

    Hope that makes sense.

  4. #4
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    You may be able to get what you need in the current version by running WebMerge in two passes, where the first pass generates a useful index linking to detail pages which are just dummy placeholder, and the second passes sets up the index pages to use the same file names as the previous placeholder detail pages in which you could write multiple records.

    See the tutorial links at the top of this page for tips on setting up multi-tiered sites with sequenced WebMerge settings.

    Let me know if you run into snags and we'll see what we can go to get you going.
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  5. #5
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    Almost forgot this:
    > I also figured out how to replace to non-web-friendly characters using regex
    > and bbedit in a click of a button.

    That's too much work. Maybe there's something we either already have or could add to take care of that for you.

    What exactly are those characters that were giving you trouble?
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  6. #6
    Newbie
    Join Date
    September 4th, 2009
    Posts
    10
    Ok, I've went through the tutorials and maybe I'm just burnt right now. Here is a sample data set, and whet I'm trying to achieve - hopefully someone can make sense of it.
    Code:
    "id";"Title";"Letter";"System";"Feature";"FeatureDesc"
    "1";"Alpha 1";"S";"SONY";"Sample Feature 1";"A feature description goes here."
    "2";"Alpha 1";"S";"SONY";"Sample Feature 2";"A second description goes here."
    "3";"Alpha 2";"J";"JVC";"Sample Feature 1";"A feature description goes here."
    Based on the mock data set above I would like to get the following detail pages to print:

    ###PAGE1###
    Title - System
    Feature: FeatureDesc
    Feature: FeatureDesc (if second exists)
    Feature: FeatureDesc (if third, etc.)

    ###PAGE2###
    Same, moving on to next title with Feature and FeatureDesc.

    **** So, the problem I'm having is getting a detail page to process the Features and Descriptions of the Titles when there is more than one Feature, it simply overwrites the other feature.

  7. #7
    Newbie
    Join Date
    September 4th, 2009
    Posts
    10
    Wink
    Code:
    <h3>[WM-Field: Title raw nolink] - [WM-Field: System raw nolink]</h3>
    
    [WM-Record]
    <p><b>[WM-Field: Feature raw nolink]</b><br>
    [WM-Field: FeatureDesc raw nolink]<br>
    [WM-Field: Name]</p>[/WM-Record]
    OK, so I figured out the two pass method works for what I need, perfectly. The Above is the code in case it helps anyone else as an example.

    One thing I wasn't grasping, which now seems so basic, is that if the code is within the record tag it will repeat (given the index settings change on Title in this case). Also worth pointing out that this is all done with index templates, no detail templates (another thing I didn't realize).

    Thanks for the help! I'm sure I'll have more questions for you as I move through this data. So far all of my questions I have discovered are actually answered in the Help files, but they aren't quite obvious, so to speak.

  8. #8
    Newbie
    Join Date
    September 4th, 2009
    Posts
    10
    Actually, here is my next question... How can I have webmerge use the filename in the generated pages in the generated page, and truncate it to say 20 characters.

    Seems mexlen can truncate ok, but how do I specify the filename (which is created by webmerge)?

  9. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Simple question, but maybe not....
    By bwh365 in forum Job Postings
    Replies: 4
    Last Post: September 29th, 2009, 08:07 PM
  2. Replies: 1
    Last Post: February 9th, 2005, 12:49 PM
  3. Simple question
    By Verbalkent in forum Newbie Affiliate FAQs & Helpful Articles
    Replies: 3
    Last Post: June 28th, 2004, 11:56 PM
  4. simple question
    By nuke in forum Commission Junction - CJ
    Replies: 10
    Last Post: March 2nd, 2004, 06:20 PM
  5. A simple question
    By dnevogt in forum Midnight Cafe'
    Replies: 7
    Last Post: October 20th, 2003, 10:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •