Jump to content


Photo

name field in Content instead in Settings tab


  • Please log in to reply
10 replies to this topic

#1 seddass

seddass

    Distinguished Member

  • Members
  • PipPipPip
  • 56 posts
  • 8

Posted 08 October 2011 - 02:46 PM

Hi, all. Sorry if this is already mentioned somewhere but i couldn't find it in the forum.
There was an issue when clients updates the "title" field but forgot to update the "name" field. I think I have saw a way to move the "name" field from Settings to Content tab with a checkbox somewhere in template settings. Now it is gone.
Is it still possible?

Thanks in advance.

P.S.
I agree that it is not goot to change the page urls.

#2 ryan

ryan

    Hero Member

  • Administrators
  • 5,773 posts
  • 3122

  • LocationAtlanta, GA

Posted 08 October 2011 - 03:02 PM

Edit your /site/config.php and locate the line that says $config->advanced = false; Change it to true. Now when editing our template, you'll see a "system" tab. Click on that tab and check the box that says to show the name field on the content tab. Save. Your name field should now show on the content tab for pages using that template.

You don't want to keep $config->advanced on as it's meant for PW core/system development rather than regular development, and it can get you in trouble (I always keep it off unless I need something in it temporarily). So go back immediately and edit your /site/config.php and set advanced back to false.

#3 seddass

seddass

    Distinguished Member

  • Members
  • PipPipPip
  • 56 posts
  • 8

Posted 08 October 2011 - 03:19 PM

Oh, yes.
Thank you!

#4 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,526 posts
  • 854

  • LocationVihti, Finland

Posted 08 October 2011 - 04:27 PM

Btw is it planned to have access management per tab? I remember Ryan mentioned that per field access management is coming (it would allow great workflows etc) and I assume that this would allow us to have per tab management too? (at least for custom tabs, but how about settings tab?)

#5 ryan

ryan

    Hero Member

  • Administrators
  • 5,773 posts
  • 3122

  • LocationAtlanta, GA

Posted 10 October 2011 - 12:10 PM

I hadn't planned on per-tab access control, though I suppose it would make sense with field-level access control since tabs are defined as fields containing other fields. Items under children, settings and delete already have granular access control, so worry a little about confusion from bringing in tab access control. But will give this more thought and consideration as we get into development of field-level access control.

#6 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,526 posts
  • 854

  • LocationVihti, Finland

Posted 04 November 2011 - 08:18 AM

Edit your /site/config.php and locate the line that says $config->advanced = false; Change it to true. Now when editing our template, you'll see a "system" tab. Click on that tab and check the box that says to show the name field on the content tab. Save. Your name field should now show on the content tab for pages using that template.


How to do this from API? Need this in one module I am building.

#7 Soma

Soma

    Hero Member

  • Moderators
  • 3,197 posts
  • 1751

  • LocationSH, Switzerland

Posted 04 November 2011 - 08:35 AM

How to do this from API? Need this in one module I am building.



$tmpl->nameContentTab = 1;


@somartist | modules created | support me, flattr my work flattr.com


#8 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,526 posts
  • 854

  • LocationVihti, Finland

Posted 04 November 2011 - 08:42 AM

Ahh.. I actually totally misunderstood that quote from Ryan :)

What I need to do is to add new fields to settings tab. Is that currently possible?

EDIT: And thanks and [applaud] Soma! You are so helpful that I am beginning to think your help as granted...

#9 Soma

Soma

    Hero Member

  • Moderators
  • 3,197 posts
  • 1751

  • LocationSH, Switzerland

Posted 04 November 2011 - 08:59 AM

You're welcome, glad if I can help. :) Thanks for the applaud  8)

Not sure what exactly you want to archive... on template settings tab?

I remember a related subject in this thread first page...
http://processwire.c...opic,414.0.html

@somartist | modules created | support me, flattr my work flattr.com


#10 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,526 posts
  • 854

  • LocationVihti, Finland

Posted 04 November 2011 - 09:21 AM

I am adding new field to a template, but would love to have it under settings tab when editing page, instead of content or custom tab.

#11 ryan

ryan

    Hero Member

  • Administrators
  • 5,773 posts
  • 3122

  • LocationAtlanta, GA

Posted 04 November 2011 - 09:57 AM

To add something to the settings tab, hook into ProcessPageEdit::buildFormSettings

It returns an InputfieldWrapper that you can append() or prepend() fields, or you can even do something like this:

<?php
$wrapper = $event->return; 
$templateField = $wrapper->get('template'); 
$myField = wire('modules')->get('InputfieldText');
$myField->attr('name', 'hello');
$myField->label = "Hello there";
$wrapper->insertAfter($myField, $templateField); 
$event->return = $wrapper; 

But I think it's better to just append or prepend to the the wrapper, because you don't really know for sure which fields will be active on the settings tab. Also note that on some pages, there is no settings tab.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users