Results 1 to 8 of 8

Thread: Coding Question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2005
    Location
    Posts
    26

    Default Coding Question

    Hi all,
    I am wondering if it is possible to have OCD not display the text for the label of a custom field. Example, if I enter "hi" into custom field 4 box, what will return is "custom field 4:hi" (
    or whatever i may rename that label.) can it just say "hi"? It would also work if the label could adjust itself based upon what I enter into the box, but that seems even more problematic. Such as, if I enter "a", it simply says "hello", and if I enter "b", it would then say "howdy", or what-have-you.
    Maybe one of you helpful coders out there have an idea? Thanks much.

  2. #2
    Join Date
    Jun 2005
    Location
    Posts
    26

    Default Re: Coding Question

    OK, I took care of that one. Thanks anyway folks if you were thinking on it.

  3. #3
    Join Date
    Jun 2005
    Location
    Posts
    26

    Default Re: Coding Question

    So now what I am wondering is this: can I have the text I enter appear in different colors depending upon what I have entered? i.e., "hello" appears in yellow, "howdy" appears in red? Something along those lines. Thanks.

  4. #4
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: Coding Question

    Yes, you can. If you pass the value of the custom field to a javascript, you can format it exactly the way you want.

    The javascript function could be something like this:

    [color=green]function colorMyText(val)
    {

  5. #5
    Join Date
    Jun 2005
    Location
    Posts
    26

    Default Re: Coding Question

    Great, Paul, you are the man! Unfortunately, I am not . I am running into an issue- I already have a js function in the album page header that creates icons based on trackauthor value, when I enter this new function after it in the header, it disables them both. I am no whiz, i just cut and paste . What am I missing with the placement of the function? Also, I inserted the call in the area that says:
    <!--[if($show_custom4)]-->
    <!--[if(custom4)]-->
    </b>
    <script language="javascript">
    <!--
    colorMyText("dax:custom4/");
    //-->
    </script>
    </b><!--[custom4/]--><br>
    <!--[/if]-->
    <!--[/if]-->

    I tried a few different placements, so I have no idea if I inserting this after the correct line or anything. I may be placing them both incorrectly. Sorry I am so lame. I prostrate myself before your wisdom and lead where you follow me. (Now thats a vote of confidence!)

  6. #6
    Join Date
    Jun 2005
    Location
    Posts
    26

    Default Re: Coding Question

    Sorry, I realize part of the problem was that I forgot to mention I am in the old version of OCD, and the new uses different tags. I hadn't gotten into the editor to know they had changed. I have made so many little changes to the daxedit in the old version I fear I could never get it back quite the same if I went to 6.x. But I am happy with it. Ok thanks.

  7. #7
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: Coding Question

    Hi meells

    You can have as many javascript functions you like in the header section or anywhere else for that matter. But the code has to be correct.

    Since you're using OCD 5.x, you can't use the new DAX-tags. The only difference in the script I posted is in the last part, which should look like this:


    <script language="javascript">
    <!--
    colorMyText("<!--[Custom1/]-->");
    //-->
    </script>


    -paul-




  8. #8
    Join Date
    Mar 2004
    Location
    Posts
    312

    Default Re: Coding Question

    Hi meells

    Moving from OCD 5.x to OCD 6.x is really not that difficult. I would strongly recommend that you switch to the latest version, and use the new DAX-fomat.

    This is what you need to do to your template:

    1. Make a backup copy of the template you are using (and have modified). If the original is called Crisp.dax, you could name the copy Crisp6.dax, for instance. (Actually it might be a good idea to also do a complete backup of your Template folder)

    2. Make a copy of your OCD database folder (that's the folder where your *.dab-files are located). Backup the entire folder.

    3. Download the latest OCD 6.x version, and install it. But first make sure you've got a copy of the OCD 5.2.x installation file, in case you decide you want to go back to the old version.

    4. Open your template copy (Crisp6.dax) in the new version 6.x Dax-editor (C:\Program Files\OrangeCD\daxedit.exe)

    5. Select the Declarations tab, and add the following line to the top of the Declarations page:

    DAX_VERSION = 2;

    6. Select one tab at a time (Start, Album etc...) and perform the following search and replace operations (CTRL+H) on each page:

    i)

Posting Permissions

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