Jump to content

uzlander

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by uzlander

  1. Oh, thank you so much for elaborating && kind reply )). Am about to test your solution above #da2#, i believe it should work though.. I've been out for a while and now having an issue accessing an OS(zorin glitch), so i'm gonna start over with fresh installation and work it through. Thanks a lot !:)
  2. Hi there! I've been looking for some similar solutions, but my case with the admin section setting/overriding default values, (need to setAndSave ''disable_automatic_append_of_file:_main.php' => true', 'prepend_file' => 'site-globals.php'), doing above modification in templates/admin.php, it seems like i'm missing something or it just doesn't reflect in the admin corresponding tabs. Please somebody correct me
  3. Yeah, seems like i need to refresh my knowledge on php fundamentals, much thankful for rapid help !:) Corrected: <img src="<?=$config->images_url.'logo.png';?>" alt=""> with corresponding line in config.php: $config->images_url = $config->urls->templates.'images/';
  4. This is a copy of the original site folder in my processwire installed, experimenting with the copy ))
  5. Hi everyone! I admit it sounds a bit silly, but i can't do simply <img src="<?=$config->images_path.'pw3.png';?>" alt='pw-logo'> ($config->images_path i've defined in my config.php, it points correct). On the page it shows alt text though. What am i missing ? ?
  6. Fantastic(!) Such a rapid reply, and it worked! Looks like i have yet to learn much myself to be any good at php & PW APIs to deal with :). ThankYou, love the processwire community
  7. Hi there, i've been trying to create a module which works in the admin panel, and does the following: Auto-fill the "summary" field with some body excerpt in case the user leaves it blank. Can't figure what is wrong and it refuses to function as i expect. So, the code: <?php namespace ProcessWire; class FillSummaryHook extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Fill Summary Field', 'summary' => 'Useful module', 'version' => 0.4, 'autoload' => true, ); } public function ready() { $this->pages->addHookBefore('saved', function($event) { $page = $event->arguments[0]; $summaryField = $page->field('summary'); $bodyField = $page->field('body'); // If the summary field is empty, set it to the body excerpt if (empty($summaryField->value)) { $summaryField->value = strip_tags(substr($bodyField->value, 0, 192)); } }); } } The file's named: "FillSummaryHook.module" which is inside the same named folder within "modules" directory. On saving the page it outputs (screenshot)
×
×
  • Create New...