View Full Version : section title for weblinks
JohnsonbI4
12-11-2006, 05:45 AM
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.
???
pheisholt
12-11-2006, 01:19 PM
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-
JohnsonbI4
12-12-2006, 02:45 AM
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?
JohnsonbI4
12-14-2006, 04:55 AM
2 pheisholt:
that's how i did the notes title disappear:
<dax:if(comment||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>
pheisholt
12-14-2006, 02:36 PM
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-
pheisholt
12-15-2006, 05:26 PM
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-
andrei_c
12-15-2006, 06:37 PM
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
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.