How do I set a redirection in MediaWiki? - redirect

$links['namespaces']['contacto'] = array(
'class' => false, // false or 'selected', defines whether the tab should be highlighted
'text' => 'Contacto', // what the tab says
'href' => $maintitle->getFullURL(), // where it links to
'context' => 'Contacto',
);
I've created a page tabs that i want to redirect to another page within my Wiki.
How do I set the redirect rule in 'href' in that code above?

Related

Show a list in page view in TYPO3 backend

I have a custom table that can be edited by users in List view in TYPO3 backend.
For better usability, it would be great to display that table in Page view, so they don't have to change between List view and Page view. This is possible for FE-Users (see screenshot) - so my question is: How can I have this feature for an extension table?
You can define the table in $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms'], for example via your LocalConfiguration or AdditionalConfiguration.php file.
Add a config in that section that looks like:
'EXTCONF' => array(
'cms' => array(
'db_layout' => array(
'addTables' => array(
'fe_users' => array(
0 => array(
'MENU' => '',
'fList' => 'username,usergroup,name,email,telephone,address,zip,city',
'icon' => TRUE
)
)
)
)
)
)
Find the documentation for that feature at https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Examples/TablesInPageModule/Index.html

how to disable breadcrumb for some controllers yii2?

I want disable or change breadcrumb in Yii2 application. How to do that.I
tried to change with
echo Breadcrumbs::widget([
'itemTemplate' => "<li><i>{link}</i></li>\n", // template for all links
'links' => [
[
'label' => 'Post Category',
'url' => ['post-category/view', 'id' => 10],
'template' => "<li><b>{link}</b></li>\n", // template for this link only
],
['label' => 'Sample Post', 'url' => ['post/edit', 'id' => 1]],
'Edit',
],
]);
Well, first of all change it back to default, which is:
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
According to yii2 documentation if you set the value for $links to an empty array, breadcrumbs will not show up.
How do you do it?
Check above code , the $links value in being set by $this->params['breadcrumbs'] variable, which is available in every view file. So in your view file just do this:
// empty if you don't want breadcrumbs
$this->params['breadcrumbs'] = [];
Otherwise set some value and your breadcrumbs will show up.

How to integrate newtinymce + elfinder extension in Yii?

I wanted to integrate elFinder with TinyMCE. More specifically, make it available as a button somewhere on TinyMCE (like inside insert picture dialog).
What I have done so far:
1. have newtinymce, elfinder extensions under protected/extensions folder. (The author said integrating these two would be cleaner in code)
2. have ElfinderController, TinyMceController as described on extension page.
3. inside protected/config/main.php component secion:
'widgetFactory'=>array(
'widgets'=>array(
'TinyMce'=>array(
'language'=>'en',
'settings'=>array(
'language' => 'en',
'theme' => "advanced",
'skin' => 'o2k7',
'plugins' => "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
// Theme options
'theme_advanced_buttons1' => "removeformat,pagebreak,visualchars,visualaid,|,insertlayer,moveforward,movebackward,absolute,styleprops,attribs,|,undo,redo,search,replace,cleanup,print,preview,save,newdocument",
'theme_advanced_buttons2' => "pastetext,pasteword,|,hr,blockquote,|,bullist,numlist,outdent,indent,justifyleft,justifycenter,justifyright,justifyfull,ltr,rtl,formatselect",//copy,cut,paste,
'theme_advanced_buttons3' => "nonbreaking,sub,sup,charmap,|,bold,italic,underline,strikethrough,forecolor,backcolor,fontsizeselect,fontselect",
'theme_advanced_buttons4' => "tablecontrols,|,link,unlink,anchor,|,image,media",
'theme_advanced_toolbar_location' => "top",
'theme_advanced_toolbar_align' => "right",
'theme_advanced_statusbar_location' => "bottom",
'theme_advanced_resizing' => true,
'relative_urls' => false,
'spellchecker_languages' => null,
'fileManager'=>array(
'class' => 'ext.elFinder.TinyMceElFinder',
'connectorRoute'=>'elfinder/connector',
),
)
)
)
),
4. in view file:
<?php
$this->widget('ext.tinymce.TinyMce', array(
'model' => $model,
'attribute' => 'content',
'compressorRoute' => 'tinyMce/compressor',
'htmlOptions' => array(
'rows' => 6,
'cols' => 60,
),
)); ?>
This gives me the TinyMCE editor without elFinder window as a button on TinyMCE somewhere (like inside insert picture dialog).
When I add the following inside view file, it gives me an elFinder area directly where I put the code.
<?php $this->widget('ext.elFinder.ServerFileInput', array(
'model' => $model,
'attribute' => 'content',
'connectorRoute' => 'elfinder/connector',
)
);?>
I guess this means elFinder is working. But I don't want it as a separate widget for a field, rather I want it to be part of TinyMCE as stated at the top.
What else do I need to integrate them?
It was a onfiguration problem. fileManager property was not a child of settings, but a sibling.
So config/main.php part should be something like:
'widgetFactory'=>array(
'widgets'=>array(
'TinyMce'=>array(
'language'=>'en',
'settings'=>array(...),
'fileManager'=>array(
'class' => 'ext.elFinder.TinyMceElFinder',
'connectorRoute'=>'elfinder/connector',
),

Magento Custom Module - WYSIWYG image browse issue

I have a custom module with a content field (WYSIWYG editor)
When I select the insert image button, the following popup appears. For some reason the 'browse' button at the side of the Image URL has disappeared. Can someone point me in the right direction to get the image icon back? (what block/controller etc)
What is required when adding the full featured WYSIWYG editor to a custom magento module?
This is my form field element within Form.php (block)
$fieldset->addField('post_content', 'editor', array(
'name' => 'post_content',
'label' => Mage::helper('faqs')->__('Answer'),
'title' => Mage::helper('faqs')->__('Answer'),
'style' => 'width:700px; height:500px;',
'wysiwyg' => true,
));
Thank you.
Jonny
Had to find out the hard way, but the solution is quite simple:
Please check the permissions of your Role your Admin is in unser System=>Permissions=>Roles
There you can find in the Tab "Role Resources" the Checkbox "Media Gallery". Make sure this checkbox is ticked!
Then, clean cache, log out and in again and it should work.
Cheers!
I managed to sort this by adding some configuration options to the field,
Add the following code above the addField() of your WYSIWYG,
$configSettings = Mage::getSingleton('cms/wysiwyg_config')->getConfig(
array( 'add_widgets' => false, 'add_variables' => false, 'add_images' => false, 'files_browser_window_url'=> $this->getBaseUrl().'admin/cms_wysiwyg_images/index/'));
Once you've added the code, you need to add another param to the addField called 'config' calling your $configSettings variable.
$fieldset->addField('post_content', 'editor', array(
'name' => 'post_content',
'label' => Mage::helper('faqs')->__('Answer'),
'title' => Mage::helper('faqs')->__('Answer'),
'style' => 'width:700px; height:500px;',
'wysiwyg' => true,
'config' => $configSettings
));

Stopping zend route default paramaters 'key' displaying in the URL

I have a route defined as below.
$route['manage-vehicles'] = new Zend_Controller_Router_Route(
'vehicles/manage/page/:page',
array(
'controller' => 'vehicles',
'action' => 'manage',
'page' => '1'
)
);
When the 'page' parameter is not specifically defined (e.g. in a menu constructed using the navigation component), the resultant URL is
/vehicles/manage/page
I would much prefer or the URL not to to display the default paramater key in this scenario
i.e. /vehicles/manage
Any ideas how to accomplish this would be appreciated?
Thanks.
EDIT: For clarity, I would like vehicles/manage/page/1 etc to display when the 'page' parameter is defined
The 'page' string you have in your route is not required for the page parameter to work, so all you need to do is change your route to:
$route['manage-vehicles'] = new Zend_Controller_Router_Route(
'vehicles/manage/:page',
array(
'controller' => 'vehicles',
'action' => 'manage',
'page' => '1'
)
);
you've told it which thing in the URL is 'page', so you don't need the prefix there. That's just part of the default route where the parameters are not predefined.