Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: custom fields not showing in details page

  1. #1
    Join Date
    Jul 2002
    Location
    Riyadh, Saudi Arabia
    Posts
    236

    Default custom fields not showing in details page

    Hi
    for some reason custom fields are not showing in details page, also main fields are showing even though empty, how can I show only filled fields (both main and custom)?

    Thanx in advance

    Hani

  2. #2
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    For custom field, you need to put the field name in detail_link.html file
    Code:
    <%$field_name%>
    To show only filled fields, for example description
    Code:
    <%if $description%>
    <%$description%><%/if%>

  3. #3
    Join Date
    Jul 2002
    Location
    Riyadh, Saudi Arabia
    Posts
    236

    Default

    Thanx
    First part worked great
    second part, no, Empty fields still show

    By the way, can I have a field with a default value? the link field in particular, lots of added info dont have a website, so I want mine to be the default, so they dont have to enter it if they dont have a site.

  4. #4
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Perhaps i'm not understand with your question, but try this:
    Code:
    <%if $description%>
    <%$description%>
    <%else%>
    It's default description
    <%/if%>

  5. #5
    Join Date
    Jul 2002
    Location
    Riyadh, Saudi Arabia
    Posts
    236

    Default

    Still, I want the whole field (even field name) not to show if ts empty,
    exsample, I have the name, the link and the phone number filled but not the fax nor the email
    Detail page should show only name, link and phone number.

  6. #6
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    I hope it's more clear. Below will show all (but not as you desire)

    Code:
    Name: <%$name%>
    
    Link: <%$link%>
    
    Phone: <%$phone%>
    
    Fax: <%$phone%>
    Below to hide not filled field

    Code:
    <%if $name%>Name: <%$name%><%/if%>
    
    <%if $link%>Link: <%$link%><%/if%>
    
    <%if $phone%>Phone: <%$phone%><%/if%>
    
    <%if $phone%>Fax: <%$phone%><%/if%>
    I hope you can understand the logical thing how the template work here.

  7. #7
    Join Date
    Jul 2002
    Location
    Riyadh, Saudi Arabia
    Posts
    236

    Default

    in your code its so plain, in detail_link.html it comes with a tr/td, so I guess your code will hide the field name but will keep the row, while I want to not show the row

  8. #8
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    I remove unnecessary html codes like <p> or <tables>, i just want to ilustrate how it work. Of course in real, you need to put html codes too.

  9. #9
    Join Date
    Jul 2002
    Location
    Riyadh, Saudi Arabia
    Posts
    236

    Default

    do you meansomething ike this?

    Code:
    <%if $contact_name%>
        <tr class=tbl_normal>
        <td>contact_name</td>
        <td><%$contact_name%></td>
      </tr><%/if%>
    Last edited by hdraye; 07-16-2006 at 09:46 AM.

  10. #10
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Yes.
    Code:
    <%if $contact_name%>
        <tr class=tbl_normal>
        <td>Contact Name</td>
        <td><%$contact_name%></td>
      </tr><%/if%>

  11. #11
    Join Date
    Jul 2002
    Location
    Riyadh, Saudi Arabia
    Posts
    236

    Default

    great
    Thanx

    now, input field when submetting a link, can we have the link optional, if not have a default value?

    Thanx again

    Hani

  12. #12
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    You need to hack add.php for required fields and default value. For custom fields, you can manage it in admin panel > database > alter. There you'll find default value, required, and searchable option.

  13. #13
    Join Date
    Jul 2002
    Location
    Riyadh, Saudi Arabia
    Posts
    236

    Default

    Thanx a million, I am going for the unlimited licence, this is great, only if dmoz can parse arabic, then I'll dance

    regards

    Hani

  14. #14
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    If you have dmoz extractor license, you can request us to parse the arabic

  15. #15
    Join Date
    Jul 2002
    Location
    Riyadh, Saudi Arabia
    Posts
    236

    Default

    Yes I have a DMOZ Ext. license, and infact I have a ticket in this regard

Similar Threads

  1. Custom fields
    By zopm in forum v5.x
    Replies: 8
    Last Post: 04-06-2005, 12:15 AM
  2. Custom Fields
    By devbite in forum v5.x
    Replies: 2
    Last Post: 11-05-2003, 03:05 PM
  3. Custom Fields and Details Page
    By craven in forum v5.x
    Replies: 2
    Last Post: 08-04-2002, 09:45 PM
  4. Replies: 1
    Last Post: 06-24-2002, 06:23 PM
  5. Are the custom fields searchable?
    By Phil Latio in forum v5.x
    Replies: 0
    Last Post: 02-04-2002, 10:16 PM

Posting Permissions

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