Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FieldGroup remove Title/label #3597

Closed
blpraveen opened this issue Nov 3, 2014 · 1 comment
Closed

FieldGroup remove Title/label #3597

blpraveen opened this issue Nov 3, 2014 · 1 comment

Comments

@blpraveen
Copy link

I am trying to remove the FieldGroup from a children page which has set title. I could not do that instead I have to remove each fields and then the title. But there was no way to remove the Label/Title. I modified the template FieldGroup_Holder.ss. to show the labels in FieldGroup only when FieldListexists.

<% if $FieldList.count %>
<div <% if $Name %>id="$Name"<% end_if %> class="field <% if $extraClass %>$extraClass<% end_if %>">
    <% if $Title %><label class="left">$Title</label><% end_if %>

    <div class="middleColumn fieldgroup<% if $Zebra %> fieldgroup-$Zebra<% end_if %>">
        <% loop $FieldList %>
            <div class="fieldgroup-field $FirstLast $EvenOdd">
                $SmallFieldHolder
            </div>
        <% end_loop %>
    </div>
    <% if $RightTitle %><label class="right">$RightTitle</label><% end_if %>
    <% if $Message %><span class="message $MessageType">$Message</span><% end_if %>
    <% if $Description %><span class="description">$Description</span><% end_if %>
</div>
<% end_if %>

And also could there be a option to remove the composite fields at once instead of remove each fields.

@chillu
Copy link
Member

chillu commented May 18, 2017

FieldList->removeByName($fieldName, $dataFieldOnly = false) should allow you to remove a FieldGroup. Can you please paste the PHP that doesn't work for you? Are you doing this in getCMSFields()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants