Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#109 2009-05-20 15:58:18

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

progre55 wrote:

Does anyone know how I can hide the “View Site” Tab? I am using ied_hide_in_admin but this is not an option.

Using the same example above and a little javascript $("#view-site").hide(); should do it.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#110 2009-05-21 00:43:50

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

MattD wrote:

Using the same example above and a little javascript $("#view-site").hide(); should do it.

Maybe I’m wrong but I don’t see such an id (#view-site). I fear you have to use a more convolute selector.

Offline

#111 2009-05-21 05:24:05

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

Sorry, forgot I was using an Admin Theme.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#112 2009-05-21 16:17:10

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

redbot wrote:


Maybe I’m wrong but I don’t see such an id (#view-site). I fear you have to use a more convolute selector.

This should work

$("#nav-primary td table td:gt(4)").hide();


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#113 2010-05-20 10:15:32

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

there is some way to hide certain sections from different users?
I need help….


<txp:txp_me />

Offline

#114 2010-05-26 04:59:32

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

I would very much like to alter what is shown on the admin>content>article page (index.php?event=list).

I want to hide specific “articles_detail” fields (but not all of them!). I can achieve a lot with CSS of course, all in fact with CSS3 but i need an option that works in browsers that don’t support nth-child() selector.

1. What is the best way of going about this.
2. Is it an option to extend the plugin to tackle the index.php?event=list page where article list is show.
3. If so what do i need to alter


I think, therefore I AM, … … er … I think :-?

Offline

#115 2010-05-26 08:52:05

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

Timid&friendly wrote:

…want to hide specific “articles_detail” fields (but not all of them!). I can achieve a lot with CSS of course, all in fact with CSS3 but i need an option that works in browsers that don’t support nth-child() selector.

Hi,
I think the only way is writing a little plugin and using javscript (or Jquery).
I agree it would be a lot easier if each table cell had a class depending on the column it belongs to but I don’t think this will be implemented (I already asked for it in the past).
If you have a basic understanding of how plugins work just istall ied_plugin_composer and write something like this (not tested):

if(@txpinterface == 'admin') {
    register_callback('xxx_hide', 'list');
} 
function xxx_hide()
{
    echo '<script language="javascript" type="text/javascript">'.
        '$(document).ready(function() {'.
             '("#list td:nth-child(2)").hide();'.
             '("#list td:nth-child(3)").hide();'.
        '});'.
    '</script>;';
}

Last edited by redbot (2010-05-26 08:52:28)

Offline

#116 2010-05-26 14:04:03

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

I’m a designer/frontender so know nothing about how plugins work. But i’ll take a look at your suggestion. I’m up for a challenge. Thx for the tip.


I think, therefore I AM, … … er … I think :-?

Offline

#117 2010-05-26 14:36:55

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

Timid&friendly wrote:

I’m a designer/frontender so know nothing about how plugins work. But i’ll take a look at your suggestion. I’m up for a challenge. Thx for the tip.

Ok, try to follow these steps:

  1. download and install ied_plugin_composer
  2. go to the plugin extension page, create a new plugin, call it whatever you want (in my example xxx_hide) and choose “admin” as plugin type. Then paste the code below in the main window.
  3. see comment in the code I posted for customization (after’//’)
if(@txpinterface == 'admin') {
    register_callback('xxx_hide', 'list');
} 
function xxx_hide()
{
    echo '<script language="javascript" type="text/javascript">'.
        '$(document).ready(function() {'.
             '("#list td:nth-child(2)").hide();'. // replace with the column number you want to hide. a line for every column
             '("#list td:nth-child(3)").hide();'.
        '});'.
    '</script>;';
}

Offline

#118 2010-05-26 16:03:29

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

You can use jmd_admin_js to load javascript on the admin pages.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#119 2010-05-26 16:56:13

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

Ok thx. Did everything but plugin is not executed?
(edit) I mean the plugin created by plugin creator, and yes it is on ;-)

I tested the Jquery script and noticed the missing $ before each statement; got that running in firebug console np.

But the plugin side doesn’t seem to do anything. I even simplified it to to make sure that it isn’t a typo:-

if(@txpinterface == 'admin') {
    register_callback('hi', 'list');
} 
function hi()
{
    echo 'hello';
}

What is the the second parameter (list)? in the @register_callback(‘xxx_hide’, ‘list’); function? and what does it do?
Remember (php nood present)

Last edited by Timid&friendly (2010-05-26 17:04:31)


I think, therefore I AM, … … er … I think :-?

Offline

#120 2010-05-26 18:47:01

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: [plugin] [ORPHAN] ied_hide_in_admin version 0.1.: Hide Fields in Admin

Timid&friendly wrote:

…I tested the Jquery script and noticed the missing $ before each statement; got that running in firebug console np.

Oops sorry you’re right , I forgot the ‘$’

…What is the the second parameter (list)? in the @register_callback(‘xxx_hide’, ‘list’); function? and what does it do?
Remember (php nood present)

‘list’ is the event for the article page. If you point to the ‘articles’ page and look at the url you’ll see “…./yoursite/textpattern/?event=list. This means that the function ‘hi’ is executed only in the ‘articles’ page.
Onestly I can’t see why your example isn’t working. It should. Probably I’m overlooking something stupid…

Offline

Board footer

Powered by FluxBB