Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-10-02 16:05:26

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

Add new item/link to admin menu

Hi eveyone.
I’ve created a fixed article in the section “options” with a lot of general options in order to my client can set up called ‘General Settings’. I’d like to add the link to this article into the admin menu in order to improve the UX instead to look it up in the ‘Articles’ tab every time. Neither, I wouldn’t want to have to hardcode the TXP core. Therefore, do you know if there is any plugin would let/avoid me do that?
Regards

Offline

#2 2014-10-02 16:43:12

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Add new item/link to admin menu

That’s something for JS/jQ:

$(document).ready(function() {
	$("ul.data-dropdown").append('<li class="dropdown inactive"><a href="URL-TO-YOUR-ARTICLE" class="dropdown-toggle">General Settings<\/a><\/li>');
});

Adds a top level menu item (in Hive).

  • Install jmd_admin_js and stm_javascript and paste the code right into the default form. (I’ve forgotten whether spf_javascript unites these two or if you still need jmd’s plugin along with it.)
  • Or add the snippet to the end of /textpattern/textpattern.js (Needs your attention on updating Textpattern, though.)
  • Or put it in bot_wtc’s JS textarea but have it available only on the Write panel.

Enjoy!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2014-10-02 16:49:35

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: Add new item/link to admin menu

Take a look at smd_tabber. You could use that to code a special tab for the admin area, or if it’s still fine to edit the article in the write tab, you can simply create a direct link in your dashboard tab that opens it in the write tab.

To give you an idea, I have something like this in my tabber_dashboard page template:

<div class="col_one">
    <h3>Get started</p>
    <ul class="welcome_options">
      <li class="article"><a href="?event=article">Write a new article</a></li>
      <li class="featured"><a href="?event=smd_featured">Change frontpage features</a></li>
      <li class="image"><a href="?event=image">Upload an image (jpg/gif/png)</a></li>
      <li class="file"><a href="?event=file">Upload a file (pdf/doc)</a></li>
      <li class="file"><a href="?event=discuss">Moderate comments</a></li>
      <li class="password"><a href="?event=admin">Change my email/password</a></li>
    </ul>
  </div>

  <div class="col_two">
    <h3>Article quick links</h3>
    <ul class="article_filter">
      <li><a href="?event=list">See a list of <strong>ALL articles</strong></a></li>
      <li><a href="?search_method=section&crit=news&event=list&step=list&search=Go">Show just <strong>news articles</strong></a></li>
      <li><a href="?search_method=section&crit=work&event=list&step=list&search=Go">Show just <strong>work articles</strong></a></li>
      <li><a href="?search_method=section&crit=people&event=list&step=list&search=Go">Show just <strong>people articles</strong></a></li>
    </ul>
  </div>

  <div class="col_three">
    <h3>Recent articles</h3>
    <ul class="recent_articles">
  <txp:article_custom time="any" limit="6">
      <li><a href="?event=article&step=edit&ID=<txp:article_id />"><txp:title /></a></li></txp:article_custom>
    </ul>
  </div>

TXP Builders – finely-crafted code, design and txp

Offline

#4 2014-10-02 17:33:20

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Add new item/link to admin menu

uli wrote #284457:

That’s something for JS/jQ

No, it isn’t: I’ve not thought of privileges, everybody would see the link. You better follow jakob’s advice.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2014-10-03 05:14:35

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

Re: Add new item/link to admin menu

Hi Guys.
Finally, I’ve used “smd_tabber” to create the “General Setting” tab and I associated it to a page template that contains a redirect code that carries to my article with the options. I am not sure if I am doing the right, but it does what I want and with just ONE CLICK!!!
Many thanks for your advices.
Regards

Offline

Board footer

Powered by FluxBB