Remove (validation) tag line [Deleted]

DreamNetworks

Active member
Gh0stAdventures submitted a new resource:

Remove (validation) tag line - This will remove the visibility and validation of the tag line

Hi Everyone,

I received a few messages regarding the tag line in Xenforo Resource Manager.

In the meanwhile I have tried to create an addon so it would be easier for you guys. But unfortunately some file need to be edited manually.

So here by a tutorial to remove the validation of the tagline, and also an option to remove the tagline view from the resources.

FIRST MAKE A BACKUP OF SRC/ADDONS/XFRM/Entity/ResourceItem.php

Removing the...

Read more about this resource...
 

Chris D

XenForo developer
Staff member
FWIW this can be done without modifying code too but it would need an add-on that changes the entity structure accordingly.

The recommended approach would be to create a entity_structure code event listener with a hint of XFRM\Entity\ResourceItem pointing to a function defined roughly as follows:

PHP:
public static function entityStructure(Structure $structure)
{
    unset($structure->columns['tag_line']['required']);
}

I haven't tested that but it looks about right to me :)
 

DreamNetworks

Active member
I have implemented it, and works great actually! Only I just don't know how to add an option for enabling and disabling this from the ACP.. Can you help me a little bit with that?
 

Chris D

XenForo developer
Staff member
If the add-on's only purpose is to remove the tag line requirement then it probably doesn't need an on/off switch as if someone didn't want that feature they could just remove the add-on or disable it.

If you still require an option and need help with that, posting a new thread in XenForo development discussions is the best course of action.
 

Cl0udzz

Member
everything works fine on 2.2.6 !
thank you so much for this help Gh0stAdventures !
I really really appreciate that ;)

Im looking for an way to remove the tagline since a very long time ^^
now.. finally ... its gone <3

Man you are amazing ;)
Thanks !
 

DaveL

Well-known member
Hi @Gh0stAdventures ,
Any idea on the following server error at all? Happens whenever a resource is added.

Code:
     ErrorException: Template error: [E_USER_WARNING] Macro public:xfrm_resource_edit_macros:tag_line is unknown src/XF/Template/Templater.php:657
    
     Stack trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/davelegg/...', 657, Array)
#1 src/XF/Template/Templater.php(657): trigger_error('Macro public:xf...', 512)
#2 src/XF/Template/Templater.php(770): XF\Template\Templater->getTemplateMacro('public', 'xfrm_resource_e...', 'tag_line')
#3 internal_data/code_cache/templates/l1/s4/public/xfrm_category_add_resource.php(110): XF\Template\Templater->callMacro('xfrm_resource_e...', 'tag_line', Array, Array)
#4 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(XFA\CustomUsernameIcons\XF\Template\Templater), Array, NULL)
#5 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfrm_category_a...', Array)
#6 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#7 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XFRM:Category\\A...', 'public:xfrm_cat...', Array)
#8 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#12 src/XF.php(517): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}
 

DreamNetworks

Active member
Hi @Gh0stAdventures ,
Any idea on the following server error at all? Happens whenever a resource is added.

Code:
     ErrorException: Template error: [E_USER_WARNING] Macro public:xfrm_resource_edit_macros:tag_line is unknown src/XF/Template/Templater.php:657
   
     Stack trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/davelegg/...', 657, Array)
#1 src/XF/Template/Templater.php(657): trigger_error('Macro public:xf...', 512)
#2 src/XF/Template/Templater.php(770): XF\Template\Templater->getTemplateMacro('public', 'xfrm_resource_e...', 'tag_line')
#3 internal_data/code_cache/templates/l1/s4/public/xfrm_category_add_resource.php(110): XF\Template\Templater->callMacro('xfrm_resource_e...', 'tag_line', Array, Array)
#4 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(XFA\CustomUsernameIcons\XF\Template\Templater), Array, NULL)
#5 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfrm_category_a...', Array)
#6 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#7 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XFRM:Category\\A...', 'public:xfrm_cat...', Array)
#8 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#12 src/XF.php(517): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}
Did you used the tutorial or my addon?
 
Top