Zum Inhalt springen

Hide unwanted categories in +create link


pushpendra
 Teilen

Empfohlene Beiträge

How can I hide unnecessary categories/subcategories in +create link. All I need to show only those categories to the members in which they can upload the files. Rest categories must be hidden in place of disabled. Members of my site always complains that if they are not permitted to upload in a category why I am showing them the category in disabled mode.
As of now I have a bunch of categories and subcategories and this feel bad to scroll and find the desired one. 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi, the easiest and most update compatible way is CSS. For example if you want to hide a link (application or pages database) you can do that with ...

#elCreateNew_menu li a[href="https://invisionfocus.de/?&do=form&d=1"] {
display: none;
}

Simply copy and paste the existing entry and put that in your custom.css

If you want to hide entries for selected groups only you have to add a condition, look here ...

{{if \IPS\Member::loggedIn()->member_group_id === 4}}
#elCreateNew_menu li a[href="https://invisionfocus.de/?&do=form&d=1"] {
display: none;
}
{{endif}}

The other method would be to edit the create menu code in the templates, but that can be overwritten with updates.

At the moment there is afaik no plugin in the marketplace to hide entries from the create menu.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Then I guess replacing the content of the create menu with your own entries/code is the best solution. To keep it upgrade-safe put it in a plugin with a theme hook. Should be in ...

Template userbar ->

				<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>

Template mobileNavigation ->

<div id='elMobileCreateMenuDrawer' class='ipsDrawer ipsHide'>
	<div class='ipsDrawer_menu'>
		<a href='#' class='ipsDrawer_close' data-action='close'><span>&times;</span></a>
		<div class='ipsDrawer_content ipsSpacer_bottom ipsPad'>
			<ul class='ipsDrawer_list'>
				<li class="ipsDrawer_listTitle ipsType_reset">{lang="add"}...</li>
				{{foreach \IPS\Member::loggedIn()->createMenu() as $k => $url}}
					<li>
						<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}} data-ipsdialog-fixed="true"
							>{lang="$k"}</a>
					</li>
				{{endforeach}}
			</ul>
		</div>
	</div>
</div>

Untested, this is afetr taking a short look only.

  • Danke 1
Link zu diesem Kommentar
Auf anderen Seiten teilen

  • V0RT3X hat Thema gesperrt
Gast
Dieses Thema wurde nun für weitere Antworten gesperrt.
 Teilen

  • Wer ist Online   0 Benutzer

    • Keine registrierten Benutzer online.
×
×
  • Neu erstellen...

Wichtige Information

Um unsere Webseite für Sie optimal zu gestalten und fortlaufend verbessern zu können, verwenden wir Cookies. Durch die weitere Nutzung der Webseite stimmen Sie der Verwendung von Cookies zu. Weitere Informationen zu Cookies erhalten Sie in unserer Datenschutzerklärung.