17488 Posts in 4473 Topics by 1978 members
|Go to End|
31 July 2008 at 6:22am
I learned the hard way that "HtmlOneLineField" does not work! But using "HtmlEditorField" as an alternativ, if you really only need one row, is wast of space and can be quit confusing for the user.
It seems as you can not change the number of rows delivered by "HtmlEditorField". Or can you? I would be more then greatful if anyone could show me how.
Anyone with a good idea how to deal with this problem?
1 August 2008 at 7:21am
Do you have some code to share?
1 August 2008 at 10:10pm
Well, I tried something like this:
$fields->addFieldToTab('Root.Content.Main', new HtmlOneLineField('Sidrubrik', 'Sidrubrik, engelsk'), 'Content');
And all I got back in the Admin was the decoration borders - no field! See attatched file!
2 August 2008 at 1:08am
My mistake... I did some digging in the api docs and found the field to be deprecated. For a single line you can use HtmlEditorField with this format:
$name = 'Sidrubrik',
$title = 'Sidrubrik, engelsk',
$rows = 1
Let me know if you have success.
2 August 2008 at 1:24am Last edited: 2 August 2008 1:28am
Thanks for your suggestion but I have tried setting $rows=1 and it doesn't work, same sad result, 15 rows or none. $rows is a protected variable!
Also tried 'hacking' but my php knowledge is limited so I had to giv in, for now at least.
2 August 2008 at 2:57am
Well, I had to dig into this to find out what was going on - didn't want to leave you hanging.
I do think this is more of a css or js issue than php. The html code generated does include inline css to set style: height. There is a min-height specified somewhere on the elements surrounding the actual editor field that's making it look like it's staying propped open.
Maybe someone from Core Dev. can help us to understand how to get this to work?
3 August 2008 at 8:44pm
Going any further is virtually impossible for an amatuer! Core Team??
28 August 2008 at 3:33pm Last edited: 28 August 2008 3:44pm
Hi, I tried constructing a new HTMLeditorfield, but encountered same problem as above. I checking the html and I'm guessing that this height declaration in the iframe is propping the field open.
<iframe style="width: 100%;height: 220px ...>
HTH. I was just wondering if it was the missing piece of the puzzle.
I was trying to setup a style-able title field, but this minor backend annoyance is... annoying.
<div id="StyledTitle" class="field htmleditor"><label class="left" for="Form_EditForm_StyledTitle">Alternative Title Field with Styling Enabled</label>
<span class="middleColumn"><textarea class="htmleditor typography" rows="1" cols="20" style="width: 97%; height: 16px; display: none;" tinymce="true" id="Form_EditForm_StyledTitle" name="StyledTitle"></textarea>
<span id="mce_editor_0_parent" class="mceEditorContainer"><table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="97%" height="16"><tbody><tr><td align="center">
<iframe style="width: 100%;height: 220px;" allowtransparency="true" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" border="0" class="mceEditorIframe" name="mce_editor_0" id="mce_editor_0" scrolling="no" width="100%" frameborder="0" height="16"></iframe></td></tr></tbody></table></span></span></div>
<div id="Date" class="field calendardate"><label class="left" for="Form_EditForm_Date">Date</label>
|Go to Top|