Silly Newbie Question - how to get rid of 'Use default' checkboxes on Asset Builder page

My Asset builder page shows a 'Use default' checkbox which is selected for every metadata field which need to be de-selected bofore data can be entered. I can't figure out how to get rid of them or uncheck by default? Sorry, can't find anywhere on the Asset builder page settings or field settings.


Thanks!

Which build are you using?

[quote]
Which build are you using?

[/quote]



Hi Duncan, build is 3.24.2.



I have created a metadata schema with various fields and applied them to an asset builder page. The asset builder page shows all the metadata fields but every one of them has the Use default checkbox selected. Just can't find an option to change this - sorry, am guessing it must be obvious…



Would love to know how to change the order of the display of the metadata fields on the asset builder page too but will finish reading the manuals first before asking about this :slight_smile:



Thanks!

I think your answer to both questions is to use the Create Form Customisation option to lay it all out yourself. The default checkbox will go and you can order the metadata how you like. Check through the manual and come back with any questions you have. :slight_smile:

[quote]
I think your answer to both questions is to use the Create Form Customisation option to lay it all out yourself. The default checkbox will go and you can order the metadata how you like. Check through the manual and come back with any questions you have. :slight_smile:

[/quote]



Thanks Rachel! Works a treat. Only exception is wysiwyg metadata type which still shows the default checkbox ticked. Have you seen this? Can't see anything in the manual about this so will use multi-line text field in the meantime.

Hmm… I've never used the wysiwyg metadata field. There doesn't seem to be one for assets that have a wysiwyg field (news item and calendar events) but I have used css to block these kind of issues in the past and I may have just overridden it and no longer remember. I know I have used css to hide the 'pre uploaded file' option when it comes to image asset builders…

I have hidden the cascade option before when front end editing, I expect it should be similar to do what you are after. Check the source of the page and look for the input field and slot some css in somewhere to deal with it.

    /* hide the cascade options */
    input[name="metadata_field_select_######_cascade_value"]{
    display:none;
    }

I don't think css will correct the problem. I have a similar asset builder where I would love for an option (in the asset builder) to avoid default values. The source code shows:

[quote]<div id="metadata_field_wysiwyg_12415_default_html_container" style="float: left; display: block;"><br></div>

<div style="float: left;">&nbsp;&nbsp;&nbsp;&nbsp;<input name="metadata_field_wysiwyg_12415_default" value="1" checked="checked" onclick="handleMetadataWYSIWYGDefaultClickFormetadata_field_wysiwyg_12415() " id="metadata_field_wysiwyg_12415_default" class="sq-form-field" type="checkbox">

<label for="metadata_field_wysiwyg_12415_default">Use default</label></div>[/quote]

[quote]
I don't think css will correct the problem. I have a similar asset builder where I would love for an option (in the asset builder) to avoid default values. The source code shows:

[/quote]



You are most probably right, you could hide the check box but still have the wysiwyg still locked with default stuff. You would have to replicate the onclick action another way through javascript to fix that. I usually hide all the labels with css too.



The other way is to check the source code of the page with the default unchecked and then hard code that into the layout.

[quote]
The other way is to check the source code of the page with the default unchecked and then hard code that into the layout.

[/quote]



From my two minute look at the source code earlier it looked like the asset builder was trying to include a lot of material for the WYSIWYG editor. If there's an easy way to hardcode that into the layout, then yes that might be an option.

[quote]
From my two minute look at the source code earlier it looked like the asset builder was trying to include a lot of material for the WYSIWYG editor. If there's an easy way to hardcode that into the layout, then yes that might be an option.

[/quote]



This is no silly newbie question or easy thing to do - I spent some time last week trying to do exactly this. If you do it with firebug as I usually do, you'll end up with the entire wysiwyg controls appearing in the page when you uncheck use default and click the green icon (another thing that needs to be 'done' before a wysiwyg metadata field will show).



I'm trying to build an easy-to-edit news tool for colleagues with no web experience whatsoever so the 'uncheck use default' thing is a major bummer.

Personally I don't like my client to use the WYSIWYG especially for non-web-experience staffs. I spent a lot of time to clean off the HTML converted by the WYSIWYG from pasting from MS Word. Instead I love the plain text fields from metadata and the paintlayout which give us the better quality control for the HMTL. The news item has two WYSIWYGs I think it's quite enough for the flexibility of the HTML input. :)’ /> <img src=‘http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/smile.gif’ class=‘bbc_emoticon’ alt=':)<br><br>Edit: generated to converted<br>

You could also just hardcode the textarea tag with the same name and id attributes, then, use the WYSIWYG editor of your choice and it will submit and save your content in the same way as the Matrix editor does. I have done this many times, using CKEditor, which is fantastic.

I’ve just been annoyed by the same issue to the point where I hacked up some ugly javascript to uncheck all and enable all the fields. (Unchecking using javascript doesn’t automatically enable the fields!) I know it’s really ugly, but it works and saves me a lot of clicking!


I hacked this down from a similar found script, so it’s not efficient, optimised or pretty. On the other hand, it only took me a few minutes.

I imagine you could invoke something like this on load and avoid clicking at all.

    
<div><a href="#" onclick='enableAll();'>+</a></div></pre>

[quote]
I’ve just been annoyed by the same issue to the point where I hacked up some ugly javascript to uncheck all and enable all the fields. (Unchecking using javascript doesn’t automatically enable the fields!) I know it’s really ugly, but it works and saves me a lot of clicking!



I hacked this down from a similar found script, so it’s not efficient, optimised or pretty. On the other hand, it only took me a few minutes.

I imagine you could invoke something like this on load and avoid clicking at all.

    
<div><a href="#" onclick='enableAll();'>+</a></div></pre><br />

[/quote]



I tried this out on a custom asset builder that uses a metadata field - it achieves the desired effect of unchecking 'use default' but also removes the green wysiwyg button if you're using wysiwyg fields. I think this is because that button is set to appear on unchecking the 'use default'.



There is a lot of code to wade through to find where the wysiwyg actually gets enabled and expanded but what I'd like to achieve is actually expanding the container with javascript as well as unchecking. I might venture into trying it with a bit of jquery if I have sufficient brain.



Nic I am also curious about how you integrated another editor - is this possible under an SLA system or did it require modifications to Matrix source?

Nic is a step ahead of you! Expanding wysiwyg


We use this in our simple edit interface, works well. :slight_smile:

[quote]
Nic I am also curious about how you integrated another editor - is this possible under an SLA system or did it require modifications to Matrix source?

[/quote]



To do this, there is absolutely no modification to Matrix code.



Basically, the normal matrix WYSIWYG editor uses a ton of javascript and then puts the contents into a textarea element at submission time. So, that textarea is on that page, just figure out what the ID of that element is, such as:


    


Make sure you copy that textarea tag, and replace the Matrix wysiwyg editor keyword with just that textarea tag. Then, you have the freedom to use something like CKEditor, which looks for a textarea field and turns it into a wysiwyg editor. And, since you are using the same textarea element and attributes that the Matrix editor uses, Matrix will save the contents just like the Matrix editor would. :)

[quote]
Nic is a step ahead of you! Expanding wysiwyg



We use this in our simple edit interface, works well. :slight_smile:

[/quote]



Thank you - this is awesome.



With a little modification I made it uncheck as well… AND hide the checkbox and label…


    


The trick is to trigger clicking the checkbox first, then the wysiwyg field :)

jQuery should come with an addiction warning.

cheers
m

[quote]
Nic I am also curious about how you integrated another editor - is this possible under an SLA system or did it require modifications to Matrix source?

[/quote]



No, if you use a regular metadata field, you can add any kind of editor on the frontend. It wont be integrated on the server (eg no htmltidy) but it will work without modifying any server code.