Results 1 to 7 of 7

Thread: section title for weblinks

  1. #1
    Join Date
    Sep 2002
    Location
    Russia, Samara
    Posts
    64

    Default section title for weblinks

    that's the same problem as in ocd 5.

    album page goes like this

    cover and info

    TRACKS
    ---------------------
    tracks

    RECORDING
    ----------------------
    recording credits

    LINE-UP
    -----------------------
    line-up credits

    NOTES
    ------------------------
    notes

    WEBLINKS
    ------------------------
    weblinks

    What is wrong with it is: if an album has no notes, NOTES section title is useless. i managed to get rid of it - it looks like this (i don't remember the tags, so i'll put it schematically)

    if (notes)
    NOTES
    ---------------
    (notes)
    if/

    I can't find the way to remove WEBLINKS title. Tags like Webshortcut or Webshortcutlink don't work. I tried to paste some scripts from a theme for ocd 5 but that just made weblinks to disappear completely no matter if there are links of not.

    ???

  2. #2
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: section title for weblinks

    Hi

    I don't know how you did Notes, but in general you can pass a field tag to a javascript, and have the javascript test for content. If there is content, then you let the javascript display headings/content etc. - using document.write("........."). If there is no content, nothing is displayed.

    In the case of Web links you'd probably have to pass these tags to the javascript: webshortcut, webshortcutlink, webshortcutdesc and webshortcuttitle

    -paul-

  3. #3
    Join Date
    Sep 2002
    Location
    Russia, Samara
    Posts
    64

    Default Re: section title for weblinks

    Quote Originally Posted by Johnsonbl4
    I tried to paste some scripts from a theme for ocd 5 but that just made weblinks to disappear completely no matter if there are links of not.
    2 pheisholt:

    could you be more specific? what exactly should i write there?

  4. #4
    Join Date
    Sep 2002
    Location
    Russia, Samara
    Posts
    64

    Default Re: section title for weblinks

    2 pheisholt:

    that's how i did the notes title disappear:

    <dax:if(comment&#124;&#124;cddbext)>
    <div class="section" id="notes">

    <table width="100%" cellpadding=0"><tr>
    <td align=left><h3 class="topper">Notes</h3>
    <td align=right><a href="#" onclick="window.external.editdisc(0,4); return false;" class="graylink"><h3 class="edit">edit</h3></a></td></tr></table><hr>

    <dax:if(comment)>
    <h3 class="topper3">Official notes</h3><p/>
    <p><dax:comment/></p><p/>
    </dax:if>

    <dax:if(cddbext)>
    <h3 class="topper3">Unofficial notes</h3><p/>
    <p><dax:cddbext/></p><p/>
    </dax:if>

    </div>

    </dax:if>

    it works.

    according to this logic this code should work for weblinks:

    <dax:if(webshortcut)>

    <div class="section" id="links">

    <table width="100%" cellpadding=0"><tr>
    <td align=left><h3 class="topper">Web links</h3>
    <td align=right><a href="#" onclick="window.external.editartist(0,1); return false;" class="graylink"><h3 class="edit">edit</h3></a></td></tr></table><hr>

    <dax:webshortcut>
    <p>

  5. #5
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: section title for weblinks

    Hi Johnsonbl4

    Could you simply send me the complete .dax file (paul@heisholt.net). Then I'll have a look at it, and get back to you.

    -paul-

  6. #6
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: section title for weblinks

    Hi Johnsonbl4

    Just want to point out that there's a major difference between the two Notes fields ('comment' and 'cddbext') and the WebLinks.

    I don't know exactly how the OCD database is designed. But let me guess:

    NOTES
    For each album there is a text field for 'comment' and another text field for 'cddbtext'. This makes it easy to determine whether these text fields contain data or not.

    WEBLINKS
    For each album there can be multiple web references. And for each web reference there can be a 'weblink' and a 'weblink description'. In other words you have to loop thru all web references for a given album in order to determine the content.

    That is most likely why you can't apply the same logic on Notes and Weblinks.

    JAVASCRIPT
    To determine whether there are any weblinks or not, you probably have to pass the weblink parameters to a javascript, and make the javascript return the result: 'empty' or 'not empty'.

    I haven't tried to do this with weblinks, but will give it a try when I have more time.

    -paul-

  7. #7
    Join Date
    Feb 2009
    Posts
    1,548

    Default Re: section title for weblinks

    Hi,

    In ideal world, you would need something like this to get rid of web link section:

    <dax:if(webshortcut)>
    ... whole web links section goes here ...
    </dax:if>

    However it does not work in current builds because webshortcut tag does not support if-query. I'll try to fix it when I get a chance, it is a trivial change.

    Andrei

Posting Permissions

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