Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/21/2017 in all areas

  1. The new Monitor Audio website is a ground up build featuring a completely custom front end design and back end Processwire build. Modules in use include Multi Language, ProCache, Blog, FormBuilder, Instagram and ProFields. The site has a large product catalogue, dealer finder and is in multiple languages. However, one of the main objectives for the project was to deliver a platform that could be easily edited and expanded as needs grow. The client team were involved at every stage. As developers we went a long way to make sure everything was editable. Other features include: IP controlled contact form with multiple email destinations based on enquiry type Product registration form with multi-product registration from a select group of products Company timeline with year filter all based on the blog platform Dealer finder with three dealer types and in multiple countries Newsletter signup with multiple signup opportunities (sign up box and other forms) FAQ section File downloads for products from internally (CMS) uploaded files or external file links There are also several other expansions and features planned. As always we'd love to hear your feedback on the site https://www.monitoraudio.com/
    8 points
  2. Hello @all, I am using UIKit now for over a year and I am totally satisfied. Ryan has created a site profile with UIKit 3 (https://processwire.com/blog/posts/introducing-a-new-processwire-site-profile/) where he uses a lot of markup functions to simplify content creation. Here is the function file of Ryan: https://github.com/ryancramerdesign/regular/blob/master/site-regular/templates/_uikit.php I want to start this topic for all users, who are also using UIKit 3 and want to share additional markup functions to extend Ryans function file. So everyone who use the new UIKit 3 framework can benefit from it. I want to start with functions to render different types of buttons: Render UIKit buttons Render UIKit buttons corresponding to https://getuikit.com/docs/button /** * Render a uikit button * * @param string $text Text for the button * @param string $style Specify one of: default, primary, secondary, danger, text, link. * @param array $options Optionally specify different options to the button. * @return string * */ function ukButton($text, $style = '', $options = array()) { if(!$text) return; $defaultoptions = array( 'tag' => 'button', //button or a tag 'type' => '', //optional button type attribute fe submit 'name' => '', //optional name attribute fe if button is inside form 'disabled' => false, //optional true or false 'href' => '', //optional href attribute; works with button and a tag, but recommended only with a tag 'rel' => '', //optional rel attribute fe nofollow 'icon' => '', //optional icon fe user, unlock 'class' => '', //optional additional class attribute fe uk-width-1-1, uk-button-small or uk-margin-small-bottom 'id' => '', //optional id attribute 'wrapper' => false, //optional add a wrapper div arround the button 'wrapperclass' => '' //optional add a class to the wrapper div fe alignment or margin ); $options = _ukMergeOptions($defaultoptions, $options); $out = ''; if($options['wrapper'] == true){ $out .= (!empty($options['wrapperclass'])) ? '<div class="'.$options['wrapperclass'].'">' : '<div>'; } $out .= ($options['tag']) ? '<'.$options['tag'].' class="uk-button' : '<button class="uk-button'; $out .= (!empty($style)) ? ' '.$style : ' uk-button-default'; $out .= (!empty($options['class'])) ? ' '.$options['class'].'"' : '"'; if(!empty($options['id'])) $out .= ' id="'.$options['id'].'"'; if($options['disabled'] == true) $out .= ' disabled'; if(!empty($options['name'])) $out .= ' name="'.$options['name'].'"'; if($options['tag'] == 'a'){ if(!empty($options['href'])) $out.= ' href="'.$options['href'].'"'; } else { $out .= ' onclick="window.location.href=\''.$options['href'].'\'"'; } if((!empty($options['href'])) && (!empty($options['rel']))) $out .= ' rel="'.$options['rel'].'"'; if(!empty($options['type'])) $out .= ' type="'.$options['type'].'"'; $out .= '>'; if(!empty($options['icon'])) $out .= ukIcon($options['icon']) . ' '; $out .= $text; $out .= ($options['tag']) ? '</'.$options['tag'].'>' : '</button>'; if($options['wrapper'] == true) $out .= '</div>'; return $out; } /** * Render a primary button; * * @param string $text * @param array $options * @return string * */ function ukButtonPrimary($text, $options = array()) { return ukButton($text, 'uk-button-primary', $options); } /** * Render a secondary button; * * @param string $text * @param array $options * @return string * */ function ukButtonSecondary($text, $options = array()) { return ukButton($text, 'uk-button-secondary', $options); } /** * Render a danger button; * * @param string $text * @param array $options * @return string * */ function ukButtonDanger($text, $options = array()) { return ukButton($text, 'uk-button-danger', $options); } /** * Render a text button; * * @param string $text * @param array $options * @return string * */ function ukButtonText($text, $options = array()) { return ukButton($text, 'uk-button-text', $options); } /** * Render a link button; * * @param string $text * @param array $options * @return string * */ function ukButtonLink($text, $options = array()) { return ukButton($text, 'uk-button-link', $options); } This code snippet uses functions from Ryans code (ukIcon() and _ukMergeOptions()), so please be sure that this functions are included in your function file as well. It would be great if other users can also post their UIKit markup functions (if you have created ones) to extend the collection. Best regards
    5 points
  3. v0.0.6 released: More efficient evaluation of dependencies.
    3 points
  4. Hi @Macrura, looking at the module code I can immediately see a much more efficient way to match the current page than what the module is doing currently. I'll post back here shortly with an update.
    3 points
  5. A sec urity sca nner found this issue on my site on admin link (/processwire/): jQuery Selector Injection What does this mean? It is possible to manipulate the jQuery selector to take control of unintended elements. What can happen? The risk depends on the context of the application. If the selector is used to click on an object and an at tacker can manipulate the selector, then it would be possible to click on buttons such as "promote to admin" or "add to shopping cart". Resources If you’d like to read up on this finding, here are some handy resources you can check out. MISC - jQuery Issue #11290: selector interpreted as HTML MISC - jQuery versions with known weaknesses It's jQuery v1.8.3. The last "good" version is jQuery v1.12.1 (it passes bugs 11290, 9521, 2432 and 11974). Is this something to worry about?
    2 points
  6. You're right, it was Tracy (not ModuleSettingsImportExport) that was the problem - I knew I had fixed that issue recently, but forgot in which module Again, sorry for the hassle with this!
    2 points
  7. This is now up to version 0.9.1 and I've moved the module's status from Alpha to Beta. New features include showing git tag points in the commit logs... ...better detection+handling of out-of-order versions in changelogs (plus some improved styles thanks to @matjazp) and the display of the remote repository-host's API read depletion condition.
    2 points
  8. @Robin S - i can confirm that this fixes the issue and the page load time is now fine (~1000ms) and with 4 inputfield dependencies. Thanks for tweaking that!
    2 points
  9. There's a story from Richard WIlliams (Animators Survival Kit), asking Milt Kahl (greatest Animator who ever lived) if he also listens to classical music during work. Milt responded, that this is the most stupid question ever, and that he's too stupid to do more than one thing at a time. Richard became a better animator instantly not listening to music anymore. He educated many animators working on computer, very addicted to music, to stop it and they all improved in their work a lot. Since I stopped listening to music (which is hard at first) while programming or painting I noticed a lot of improvement in my work.
    2 points
  10. Ok, I have tried another approach that seems to work: Replace $page = $this->process->getPage(); with $id = $this->input->get('id'); $page = wire('pages')->get('id='.$id); Let me know if it works Best regards
    2 points
  11. https://detectify.com/
    2 points
  12. @Macrura, would you mind testing the attached module update and let me know if it works as expected and improves the page load time? Just want to confirm it does the job before pushing the change to GitHub. CustomInputfieldDependencies.zip
    2 points
  13. This little tutorial is about how to change the text of the table headers of a page table field: This is what it looks like before: The text for the table headers comes from the field labels. Now we want to change this a little bit: As you can see I have changed 3 values of the table header: Beginn (Datum) -> Start Beginn (Zeit) -> Beginn Ende (Zeit) -> Ende Here is the hook to make this working. I use a "InputfieldPageTable::render" hook. This code should be placed inside init.php not ready.php $this->addHookAfter('InputfieldPageTable::render', function($event) { $id = $this->input->get('id'); $page = wire('pages')->get('id='.$id); $table = $event->object; $content = $event->return;//put the output into a variable for manipulation later on if($table->name == 'mypagetablefield'){ //only on this pagetable field - rename it to the name of your field //create an array of all fields where you want to change the header text $fieldsarray = array( //use name of the field as key and the new header text as value ($key => $value) 'field1' => __('Text 1'),//rename field1 to your field name and Text 1 to your table header text of field1 'field2' => __('Text 2')//rename field2 to your field name and Text 2 to your table header text of field2 ); $templateID = $page->template->childTemplates[0];//array of children templates IDs - in this case key 0 indicates the first (and only) template; foreach($fieldsarray as $key=>$value) { $label = wire('templates')->get($templateID)->fields->getFieldContext($key)->label;//get labels from template context $content = str_replace($label, $value, $content);//manipulate the output } $event->return = $content;//output the manipulated content } }); I know using str_replace is not the most elegant solution, but I havent found another possibility to achive this. $templateID is used to get the labels from template context. In this example I manipulate 2 field labels (labels of field1 and field2). You have to adapt it to your needs The str_replace line is for the manipulation. If someone has better and more elegant solution please post it here. There is also a problem if the page table is updated via Ajax. If so they headers return to the default value: Maybe a hook with "InputfieldPageTableAjax::checkAjax" would be also necessary. So use with caution at the moment. Edit: After removing this line from the code and putting the code into init.php it works also after updating via Ajax: if($this->process != 'ProcessPageEdit') return; //this was not a good idea to use It seems that if the page table is updated via Ajax than the process is no longer in "ProcessPageEdit" mode, so it will force the hook to not run. Removing this line from the code solves the problem. Now its working after Ajax update without any problems. Also a big thanks to @Robin S for helping me to find a working solution.
    1 point
  14. thanks Robin and Adrian!! Robins solution worked for me. Here is my final Code, with loading and sorting the files and converting them to an PageImage so that I can resize them later (if needed) This Example also uses lazysizes to load the images. Maybe this helps someone: $files_array = $item->sequenz_files->getArray(); natsort($files_array); // And if you need the files as a Pagefiles object for some reason $pagefiles = new Pagefiles($item); $pagefiles->import($files_array); // Now foreach $pagefiles $si = 0; foreach ($pagefiles as $imagefile) { if($imagefile->ext == 'jpg'){ $si++; // create a new Pageimage with the file $preloaderImage = new Pageimage($item->images, $imagefile->filename); echo "<img src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' data-src='{$preloaderImage->url}' class='{$si} lazyload' />"; } }
    1 point
  15. Very interesting post. I will listen to music while (graphic) designing and I haven't noticed any ill effects there, but if I am planning or coding I find it has a negative impact. Especially when debugging or trying to think laterally about a challenging task. Even the most ambient of background noise I find distracting in those circumstances - like some of the brain's energy gets unconsciously diverted to listening and you can bring less resources to bear on the issue as a result. Do you have an online portfolio of paintings? Would love to see some of your work.
    1 point
  16. In the selector that you use with the children() method, you can do anything that you can do in a $pages->find() selector. Because behind the scenes... $page->children($selector) ...is essentially... $pages->find("parent=$page, $selector") Like I said, I'm no expert on multi-language, but I think PW has tools that let you handle multi-language smarter than this. Have a read here about multi-language fields and here about language support in general.
    1 point
  17. So, as PWaddict predicted, turning off mod_security did the trick, but I couldn't do it with the htaccess rule. I tried that first, but it didn't do anything, so I disabled it in the Plesk control panel. (It's under 'Web Application Firewall..'; I've set it to 'detection only' rather than 'on' or 'off'. If anyone knows of a downside to this or if I can target something more directly, please let me know). But the video now appears as it should. Thanks all.
    1 point
  18. Maybe I miss-understanding, but you have a day_in_week field, what kind of field is this? Before I can answer the question, as this changes the way you can achieve this. For example if it's just text you can do: $events = $pages->find("template=weekly-event, day_in_week=Monday");
    1 point
  19. Latest available on Github (and what you'll get if you upgrade), but not actually the latest, necessarily. I am actually confused by the changelog in AOS - the dates for 1.6.71 a 1.6.7.2 are out of order - but again, this really is an unusual situation. Anyway, I really wouldn't worry too much about any of this - it was really just meant as an example of things to look out for - I don't really think anything needs changing.
    1 point
  20. Not sure it's quite right, but what about "Upgrade to:" as the label? Or some other way to highlight it as what you'll be upgrading to, rather than it being the latest available?
    1 point
  21. If possible, I would like to make it visually clear which version of the module the user will be getting once they "push the button". If I leave the label off, that won't happen.
    1 point
  22. Maybe the "Latest" tag isn't needed? Perhaps all that is relevant is the "Installed" tag. The issue with AOS is a mistaken version number 1.6.71 (I think @tpr intended 1.6.7.1). The more likely scenario is what you described where you might have a version that is newer, but not published yet - that can happen relatively often.
    1 point
  23. Render UIKit list Here is another function to create various types of lists corresponding to https://getuikit.com/docs/list /** * Render a uikit list * * @param array $listitems All list items as an array, you can also use html inside the array (fe links) * @param array $options Optionally specify different options to list. * @return string * */ function ukList($listitems = array(), $options = array()) { if(count($listitems) == 0) return; $defaults = array( 'divider' => false, 'bullet' => false, 'striped' => false, 'large' => false, 'icon' => '', // icon to display before list items 'class' => '' // add custom class to list item ); $options = _ukMergeOptions($defaults, $options); $out = ''; $classes = array(); if($options['class']) $classes = explode(' ', $options['class']); if($options['divider']) $classes[] = 'uk-list-divider'; if($options['bullet']) $classes[] = 'uk-list-bullet'; if($options['striped']) $classes[] = 'uk-list-striped'; if($options['large']) $classes[] = 'uk-list-large'; if(count($classes)) { $class = ' ' . implode(' ', $classes); } else { $class = ''; } $out .= '<ul class="uk-list'.$class.'">'; foreach($listitems as $listitem) { $out .= '<li>'; $icon = (!empty($options['icon'])) ? ukIcon($options['icon']).' ' : ''; $out .= $icon.$listitem.'</li>'; } $out .= '</ul>'; return $out; } Usage examples: echo ukList($page->children); //creates a simple unstyled list of all child pages ids echo ukList($page->children, $options = array('icon' => 'heart', 'striped' => true, 'large' => true)); //creates a striped list, with heart icon in front and a larger margin
    1 point
  24. Thanks for this, we'll investigate!
    1 point
  25. Good spot @wbmnfktr - in fact it appears to be an encoded opening php tag - %3C?php
    1 point
  26. Just stumbled across these (marked in the screenshot)... you might want to fix them and the og:image/twitter:image:src paths. But yes... as @DaveP mentioned: super clean code and clean site.
    1 point
  27. I don't remember how it was before, but is this what you are expecting in this scenario? I actually think it probably is the right way to go, but just wanting to make sure you had seen this issue with AOS.
    1 point
  28. The time I used it was a site for a courier company, so there was only one amount chargeable ('collect my stuff from A and take it to B') and no need for a 'cart' as such, so it was really easy, but the whole process is very streamlined.
    1 point
  29. Quick update. I have made very good progress. Hi all. I am intending to ONLY support ProcessWire 3.x starting from the next version of this module. Please have a read here and let me know what you think. Thanks.
    1 point
  30. You are right. It seems that when the hook fires for the AJAX reload the process is ProcessPageView and not ProcessPageEdit. So @Juergen's way of getting the page from the id GET variable would be the way to go.
    1 point
  31. After struggling with this for a few days, I've managed to fix it find a hack for it. Basically, I had to turn on debug on in config.php, go through the dependency chain of my classes and functions. I will outline some of the strategies I used but your mileage will probably vary depending on your particular situation. In my situation, this was only happening if I'm trying to generate a PDF file which is a very specific use case. Again to reiterate, I was not getting this issue with my other use cases. 1) Consolidate / Reduce your dependency tree into something smaller. That meant instead of creating an object from a class and calling a method on it, I imported the function as a whole to the calling class 2) Importing functions from a common library/classes and removing references to them. Luckily, there was only 1 function to duplicate. 3) Change all require/include calls to require_once -> include_once 4) You can try using class_exists function as a last resort, only if you're sure you've cleaned up your call chain. I just couldn't work out why it was trying to load these 2 classes twice, so I used class_exists and that was the last error I fixed before I got it to work. I had tried to use class_exist with other classes in my earlier attempts and it was just propagating the issue down the call chain. This is the hack I'm really not comfortable with, but whatever works right now I will take it. if (!class_exists("\Site\Logo")) include_once("Logo.php"); if (!class_exists("\Site\KeywordParser")) include_once("KeywordParser.php"); P/S How I got into this mess in the first place is because I have a class template that automatically does a include_once to my Library PHP file that has commonly reused functions
    1 point
  32. This is not good for the specific hook cause on the ajax update of pagetable it displays the original label header.
    1 point
  33. Nevermind. Thanks for your info. I will change the code at my first post.
    1 point
  34. Yep that works perfect. Problem is gone Thank you very much.
    1 point
  35. @Robin S Thanks for this module! I was hoping to use this for a setup where some fields need to show/hide based on their parent, but using it caused the editor page load to go from ~1883ms to ~18056ms, using 4 custom dependencies; not sure if it is totally this module or some interaction with other modules, but the speed changed back once i removed all of the custom dependencies... ProcessWire: 3.0.82 PHP: 7.1.11 Webserver: Apache MySQL: 5.6.37 CustomInputfieldDependencies: 0.0.5
    1 point
  36. Although I don't believe this is would be coming any time soon, I'd just like to leave a note here that I would really really really enjoy sqlite for processwire very much. It would be so much easier to handle and synchronise smaller sites just by version controlling the files of the project. *sigh* ... could the FileCompiler offer a new approach on creating a universal compatibility especially for 3rd party modules?
    1 point
  37. Does anyone know if it's possible to do something to "tell" PhpStorm how PW uses a template file and what variables are in scope there? For the purposes of code completion and to avoid erroneous undeclared variable warnings. Currently I manually list all API variables and variables declared in the auto-prepended _init.php inside a DocBlock at the top of every template file. This works but gets pretty tiresome, especially when you need to make a change globally. What would be cool is if PhpStorm could "know" that all API variables are available in every template file and that _init.php is prepended and so all the variables declared there are in scope. Anyone know a way to achieve this? BTW, for API variables the Functions API is a no-go for me because I dislike all the string concatenation that goes with it.
    1 point
  38. Thanks again @kongondo! For anyone following: FYI my issue was fixed. Just needed to switch on the PHP extention iconv. I got through 17 pages of this thread, glad it's fixed.
    1 point
  39. Maybe this can help? //https://github.com/FlipZoomMedia/ProcessWire-AIOM-All-In-One-Minify/issues/64 $_timestamp = ((int)$_timestamp + $file['last_modified'] + hexdec(md5(basename($file['absolute_path']))));
    1 point
  40. I just wanna give @abdus here some big praise...he really helped me out here! Thanks again dude!
    1 point
  41. Ok, this was a very weird problem. It turns out that when submitting a form with JS, value of the submit button isn't posted with the form, that's why if ($input->post->submitForm) wasn't working as it would normally. We've solved the problem by checking for another field, `stripeToken`, to ensure that the form has been posted properly before processing the credit card. https://stackoverflow.com/questions/1709301/javascript-submit-does-not-include-submit-button-value Another way to solve this problem would be listening to submit button click instead of form submit, then preventing default action, validating the form with Stripe, and actually triggering click on the button.
    1 point
  42. Recently I am fixing this issue, again, and I find this post in google. There's another solution that I found in the ListerPro forum before. The created, modified, publish date format can be changed via language translation. The language support module has to be installed in this case. Go to Setting > Language > choose the language you use > Click Find Files to Translate button > click /wire\modules\Process\ProcessPageLister\ProcessPageLister.module and submit > translate "rel" field(should be listed on top) to wanted format like Y-m-d Reference: https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/modules/Process/ProcessPageLister/ProcessPageLister.module#L238
    1 point
  43. A great module! I needed a photo gallery for a few websites and this works fantastic. Please go ahead and get this module published in the ProcessWire Module Directory.
    1 point
  44. Yay, update: https://github.com/blynx/MarkupProcesswirePhotoswipe Now has some simple 'themes', cooler ones later ... <?php $pwpswp = $modules->get('MarkupProcesswirePhotoswipe'); echo $pwpswp->renderGallery($page->nicePictures, ['theme' => 'h-scroller']); // available themes: plain, flex, h-scroller 0.7 - 2017/07/11, themes fixed: Size option correctly adopts height value added: Theme functionality added: Simple themes 'plain' (previous default), 'flex', 'h-scroller' other: Updated readme other: No notice on undefined photoswipe options other: Refactoring
    1 point
  45. Update is out: https://github.com/blynx/MarkupProcesswirePhotoswipe Also removed the Pwpswp class alias, because it was pretty pointless. Processwire does not recognise it as a module and I don't really use static methods in that class. 0.5.1 - 2017/07/06, fixes removed: Removed pointless shortcut alias class fixed: Use of correct module/class name for file paths fixed: Configuration instructions for file paths other: Updated readme
    1 point
  46. Hey Blynx, Thanks for the nice module Not sure, it's probably just me, but to get this working (local MAMP setup) I had to use the full module class name (MarkupProcesswirePhotoswipe) (not the alias Pwpswp) and the css/javascript etc paths were incorrect , so instead of MarkupPwpswp/path-to-files within the .module file, I had to change these to MarkupProcesswirePhotoswipe/path-to-files After this all worked nicely Thanks again!
    1 point
  47. Something like this works with Process type modules. First you create a submit button, change its name to your action <?php $submit = $this->modules->get('InputfieldSubmit'); $submit->name = 'action_name'; $submit->value = 'Action Title'; $submit->icon = 'save'; $form->add($submit); Then inside <?php public function execute() // or ready() or init() { $out = ''; // ... if($this->input->post('action_name')) { // do your thing $this->message('Did my thing'); $out .= 'Here are the results'; // ... } return $out; } To achieve the same thing inside plain modules, you need to check if($this->input->post('action_name')) inside ready() / init() function. However, Process modules are more suitable for these types of tasks. You get custom urlSegments that you can redirect to and process using execute[Segment] functions. Like so <?php namespace ProcessWire; class ProcessMyAction extends Process implements Module { public static function getModuleInfo() { return [ 'title' => 'My Action', 'summary' => 'Does my action when you need to', 'version' => '0.0.1', 'permission' => 'page-edit', 'icon' => 'cogs' ]; } public function execute() { /** @var InputfieldForm $form */ $form = $this->buildForm(); $out = $form->render(); if($this->input->post('action_name')) { $out .= 'Just did my thing'; } return $out; } public function executeHi() { // intercepts `./hi` url segment $this->message("Well hello"); return "<p>You clicked hi!</p>"; } public function executeBye() { // intercepts `./bye` url segment $this->setFuel('processHeadline', 'Goodbye?'); $this->error('Not so fast!'); return "<p>You clicked bye!</p>"; } public function ___install() { // set up process page that is reachable from dropdown menu try { $p = new Page(); $p->template = 'admin'; $p->parent = $this->pages->get($this->config->adminRootPageID)->child('name=setup'); // under /admin/setup $p->name = 'my-action'; $p->process = $this; // when clicked from dropdown menu, execute() function runs $p->title = 'My Action'; $p->save(); $this->message("Created action page at $p->path."); } catch (WireException $e) { $this->error('Cannot create action page'); $this->error($e->getMessage()); } } public function ___uninstall() { // delete admin page $p = $this->pages->get('name=my-action, has_parent=2'); if($p->id) { $p->delete(); $this->message("Removed Action page at $p->path"); } } protected function buildForm() { /** @var InputfieldForm $form */ $form = $this->modules->get('InputfieldForm'); /** @var InputfieldName $fName */ $fName = $this->modules->get('InputfieldName'); // ... $form->add($fName); $submit = $this->modules->get('InputfieldSubmit'); $submit->name = 'action_name'; // ... $form->add($submit); return $form; } }
    1 point
  48. Hey @Robin S - I just wanted to remind everyone how awesome this is It can reduce the number of required templates (and template files) substantially in some cases where you have a standard setup, but with some minor differences to the fields in each template. Of course you could take it to extremes and have just one template per site, so you need to be careful to find the right balance, but it's a really powerful addition to PW IMO. Thanks again!
    1 point
  49. Since you're using Redirect / RedirectMatch, both of which are features of mod_alias, there's no way that I'm aware of to do this. What you should do is move this redirect after the "RewriteEngine On" part of the .htaccess file and use a RewriteRule (mod_rewrite): RewriteRule ^onsite2/$ http://domain.com/ [R=301,L] RewriteRule ^onsitefocusedthanks/$ http://domain.com/club/ [R=301,L]
    1 point
  50. In a rush so not the cleanest code, but this seems to work for me - is this what you are looking for? $p = $pages->get(xxxx); //id of page to copy $np = new Page(); $np->of(false); $np->parent = $pages->get(1); //set parent to homepage $np->template = "basic-page"; $np->title = 'test new page'; $np->save(); $np->images->add('http://'.$config->httpHost.$p->images->last()->url); $np->save();
    1 point
×
×
  • Create New...