Jump to content

Tyssen

Members
  • Posts

    354
  • Joined

  • Last visited

Posts posted by Tyssen

  1. I'm trying to fetch an array of pages that use a certain template with:

    $my_array = $pages->find("template=xxxx");

    But for some reason, it won't return anything for the template that I'm targeting. If I change the template name to my basic page or news templates, for example, I get a list of pages output, but not for the template I want.

    Is there some setting I've inadvertently set that would cause the template's pages to not display? The template is being used for pages on the site and they display OK as single entry pages.

    Or could it be related to an issue I had with the same template yesterday where I was adding a new field to the page, and then when I went to edit the page with content in the new field, I'd get returned to the same page I was on, i.e. /processwire/page/edit/?id=XXXX but it would display the 404 template instead? And the data I'd tried to enter wouldn't be saved.

    The template only has title, multiplier, table and file fields attached to it. And the table field is also modified by the TableCSVImportExport module.

  2. Is there a way to select an image from another image field on the page, much the same way as CKEditor fields can when embedding images?

    Why not just use an ordinary image field?

    Because in my case, I have a repeater for creating a home page carousel for featured news items. Each row in the repeater has an image field. Sometimes you want to be able to use the same image for more than one slide. Currently you have to upload the same image to each row.

    And if you need to replace an image but know you'll need to use it again at a future date, you have to leave it attached to the image field but move it away from the first position so any new images can be first instead.

    So each row ends up with 5-6 different images that are used frequently for different types of topics, which is a) a bit untidy, and b) means you have to repeatedly upload common images, i.e. duplication of effort.

    It would be better if I could have a global images field for the page, and then in each repeating row, a fieldtype that can choose an existing image from that field. I thought about using a CKEditor fieldtype, but that generates all the markup too, and I don't want to do that as the markup will be generated with dynamic image sizes in the template.

    I also know of the image manager module that Soma made but that's not really what I'm after either.

    Is there any way to accomplish this?

  3. All good now, thanks. And very nice module, previewing feature especially.

    Just one small request: it would be useful to have a way to override the Title Format on certain pages, e.g. the home page. For most pages I'll want to have Page Name – Site Name, but on the home page I'll want to have Site Name – Site Description, but with title format enabled I get Site Name – Site Description – Site Name.

    • Like 1
  4. Why is upscaling false being ignored with the following template?

    foreach($page->images as $image) :
    
      $options = array(
        'quality' => 85,
        'upscaling' => false
      );
      $large_img = $image->width(800,$options);
      $thumb_img = $image->size(100,100,$options);
    
      $img .= '<a href="'.$large_img->url.'"><img src="' . $thumb_img->url .'"></a>';
    
    endforeach;

    The page I'm testing has images that are smaller than 800 but the linked versions are all 800px wide (and pixellated because they've been stretched).

  5. I'm not getting an SEO tab appear on my publish/edit pages. I'm also not seeing any seo_xxxx fields in my fields list. So I thought I should maybe uninstall and reinstall, but when I try to uninstall I get:

    Recoverable Fatal Error: Argument 1 passed to Fields::___delete() must implement interface Saveable, null given (line 265 of /wire/core/Fields.php) 
    This error message was shown because you are logged in as a Superuser. Error has been logged.

    And yes, I have specified templates to get the tab in the module's settings.

  6. Yep, that turned out to be my problem. Previous developer who created my user account before handing over did so with limited permissions. :/

    • Like 1
  7. Yeah, I did think about it, but wondered whether creating a new account, posting as a complete newbie etc., whether I might actually get a better response from somewhere I've already got a bit of history.

  8. I gather there's quite a few ex-ModX users on this forum and was wondering if someone might be able to help me out with something which should be simple but is defeating me at the moment: uploading a PDF.

    I've created a template variable and added it to a template, have checked all my file manager config settings several times and permissions on the server, but keep getting 'disallowed file type' errors. :/

  9. This question follows on from the discussion that starts here.

    A screenshot of the page tree is attached. On the subsite, the content of About displays OK, but all the subpages of About only display the page title.

    Template code is:

    <?php
    
    /**
     * NPL Page template
     *
     */
    
    if(count($page->includePage)>0) $page = $page->includePage;
    
    $outMain = '<h1>'.$page->title.'</h1>';
    
    $outMain .= $page->body;
    
    include("./npl-main.inc.php");
    

    post-967-0-29769300-1409311215_thumb.png

  10. Actually, just tried

    $outMain .= sponsor_row('Major Club Partners,$page');
    

    and that's working fine. :)

    Now I just need to know why my second level pages aren't outputting any content.

×
×
  • Create New...