Explain how to do Tips for removing + Create option

zaim

Collaborate
Collaborate
Registered
Joined
Aug 26, 2019
Messages
229
Points
253

Reputation:

1) I want this button to be removed from the header

111111.jpg.f3e5e4f9c73f471827670bad9a2af537.jpg


To do this, comment out the following lines in the userBar template. But you have to understand that the ability to create quick ads is also there....
Code:
<li id='cCreate'>
                <a href='#elCreateNew_menu' id='elCreateNew' data-ipsTooltip data-ipsMenu title='{lang="create_menu_title"}'>
                    <i class='fa fa-plus'></i> &nbsp;{lang="create_menu"} <i class='fa fa-caret-down'></i>
                </a>
                <div id='elCreateNew_menu' class='ipsMenu ipsMenu_auto ipsHide'>
                    <ul>
                        {{foreach \IPS\Member::loggedIn()->createMenu() as $k => $url}}
                            <li class="ipsMenu_item">
                                <a href="{$url['link']}"
                                {{if isset( $url['extraData'] )}}
                                    {{foreach $url['extraData'] as $data => $v}}
                                        {$data}="{$v}"
                                    {{endforeach}}
                                {{endif}}
                                {{if isset($url['title']) AND $url['title']}} data-ipsDialog-title='{lang="$url['title']"}'{{endif}}
                                {{if isset($url['flashMessage'])}} data-ipsdialog-flashmessage="{lang="$url['flashMessage']"}"{{endif}}
                                >{lang="$k"}</a>
                            </li>
                        {{endforeach}}
                    </ul>
                </div>
            </li>

2) the start new topic button should be deleted on the main page of the forum
22222.jpg.026a81cb8634e8144c4b34c871406d3f.jpg

forums > front > index > index comment out the following lines:

Code:
<div class='ipsPageHeader ipsClearfix ipsMargin_bottom cForumHeader ipsHeaderButtons ipsFlex ipsFlex-ai:center ipsFlex-jc:between'>
    <h1 class='ipsType_pageTitle ipsFlex-flex:11 ipsType_break'>
        {lang="forums"}
    </h1>
    {{if \IPS\forums\Forum::canOnAny( 'add' ) }}
        <ul class='ipsToolList ipsToolList_horizontal ipsClearfix sm:ipsPos_none sm:ipsMargin:none ipsFlex-flex:00'>
            <li class='ipsToolList_primaryAction ipsResponsive_hidePhone'>
                <a class="ipsButton ipsButton_medium ipsButton_important" href="{url="app=forums&module=forums&controller=forums&do=add" seoTemplate="topic_non_forum_add_button"}" data-ipsDialog data-ipsDialog-size='narrow' data-ipsDialog-title='{lang="select_forum"}'>{lang="start_new_topic"}</a>
            </li>
            {template="viewChange" group="global" app="forums" params=""}
        </ul>
    {{endif}}
</div>
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
793
Points
153

Reputation:

I would rather remove the lines completely or use css to remove the elements.
Commenting out will leave the code open readable in source code to others and jut doesn't look good.
 

one_finger_man

Well-known member
Registered
Joined
Jan 20, 2022
Messages
411
Points
53

Reputation:

1) I want this button to be removed from the header

View attachment 35675

To do this, comment out the following lines in the userBar template. But you have to understand that the ability to create quick ads is also there....
Code:
<li id='cCreate'>
                <a href='#elCreateNew_menu' id='elCreateNew' data-ipsTooltip data-ipsMenu title='{lang="create_menu_title"}'>
                    <i class='fa fa-plus'></i> &nbsp;{lang="create_menu"} <i class='fa fa-caret-down'></i>
                </a>
                <div id='elCreateNew_menu' class='ipsMenu ipsMenu_auto ipsHide'>
                    <ul>
                        {{foreach \IPS\Member::loggedIn()->createMenu() as $k => $url}}
                            <li class="ipsMenu_item">
                                <a href="{$url['link']}"
                                {{if isset( $url['extraData'] )}}
                                    {{foreach $url['extraData'] as $data => $v}}
                                        {$data}="{$v}"
                                    {{endforeach}}
                                {{endif}}
                                {{if isset($url['title']) AND $url['title']}} data-ipsDialog-title='{lang="$url['title']"}'{{endif}}
                                {{if isset($url['flashMessage'])}} data-ipsdialog-flashmessage="{lang="$url['flashMessage']"}"{{endif}}
                                >{lang="$k"}</a>
                            </li>
                        {{endforeach}}
                    </ul>
                </div>
            </li>

2) the start new topic button should be deleted on the main page of the forum
View attachment 35676
forums > front > index > index comment out the following lines:

Code:
<div class='ipsPageHeader ipsClearfix ipsMargin_bottom cForumHeader ipsHeaderButtons ipsFlex ipsFlex-ai:center ipsFlex-jc:between'>
    <h1 class='ipsType_pageTitle ipsFlex-flex:11 ipsType_break'>
        {lang="forums"}
    </h1>
    {{if \IPS\forums\Forum::canOnAny( 'add' ) }}
        <ul class='ipsToolList ipsToolList_horizontal ipsClearfix sm:ipsPos_none sm:ipsMargin:none ipsFlex-flex:00'>
            <li class='ipsToolList_primaryAction ipsResponsive_hidePhone'>
                <a class="ipsButton ipsButton_medium ipsButton_important" href="{url="app=forums&module=forums&controller=forums&do=add" seoTemplate="topic_non_forum_add_button"}" data-ipsDialog data-ipsDialog-size='narrow' data-ipsDialog-title='{lang="select_forum"}'>{lang="start_new_topic"}</a>
            </li>
            {template="viewChange" group="global" app="forums" params=""}
        </ul>
    {{endif}}
</div>
Haimare you telling us how to do this if you are looking to remove the start a topic
Code:
                <a class="ipsButton ipsButton_medium ipsButton_important" href="{url="app=forums&module=forums&controller=forums&do=add" seoTemplate="topic_non_forum_add_button"}" data-ipsDialog data-ipsDialog-size='narrow' data-ipsDialog-title='{lang="select_forum"}'>{lang="start_new_topic"}</a>

just remove that
 
Top