Jump to content

ArtArmstrong

Members
  • Posts

    8
  • Joined

  • Last visited

About ArtArmstrong

  • Birthday 12/31/1984

Contact Methods

  • Website URL
    http://artarmstrong.com

Profile Information

  • Gender
    Male
  • Location
    Seattle, WA

ArtArmstrong's Achievements

Newbie

Newbie (2/6)

4

Reputation

  1. I haven't seen that surprisingly but I will definitely have to check it out! Is it not installed by default on new installations?
  2. Hey, so after having used the Fieldtype Select for a few project I had some customers that wanted a radio version of this so I decided to modify it (not heavily) and make it work with radio buttons instead. I have it hosted up on github here so check it out and let me know if you have question or comments.
  3. So in previous version of PW (2.1) we were using the modified FieldtypeComments as shown here to enable nested/threaded comments which isn't compatible with the current (2.5.3) version of PW. Now unfortunately since we have updated our old installation to the newest stable we can't use this feature. I know after reading this article that is is coming but is there anyway you guys could recommend to grab the needed files and integrate it into 2.5.3? Thanks!
  4. Well inside of the module we were setting $pages->setOutputFormatting(true) before getting the variable that help the render output and then setting as false after. But just had to do the same thing inside of the template file.
  5. This looks like it was save the html from the render to a file which isnt exaclty what we were trying to do. I like the idea though. Well the odd thing is that when I would view the page via the browser I would get the full path to the image, but via the render it would only show the path to where the image is located but not the image filename. So it exists but wasnt showing the full thing. As a side note we found a fix for the problem after trying about 20 different things... The fix was to add the "setOutputFormatting" to the $a that was looping for the articles like this, not sure if it was the best way but it works: <?php $related_articles = $pages->get(1007)->children("template=article,is_national=1,related_edition={$pages->get(1021)->related_edition},related_categories!={$pages->get(1132)},sort=-date,include=all"); if ($related_articles->count()) { foreach ($related_articles as $a) { ?> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td> <a href="<?php echo base_url().$a->url; ?>" title="Learn More: <?php echo $a->title; ?>" target="_blank" style="text-decoration: none;"><?php echo ($a->headline != '') ? $a->getUnformatted("headline") : $a->title; ?></a> <?php // Set output formatting to true so article images work $a->setOutputFormatting(true); $suffix = ' <a href="'.base_url().$a->url.'" target="_blank" style="text-decoration: none;" title="Learn More: '.$a->get->title.'">Learn More »</a>'; if ($a->featured_image) { ?> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom: 10px;"> <tr> <td style="padding-right:10px;" valign="top"> <?php if ($a->featured_image->url->description != '') { ?> <a href="<?php echo $a->featured_image->url->description; ?>" title="<?php echo $a->get('headline|title'); ?>"><img src="<?php echo base_url().$a->featured_image->url; ?>" alt="<?php echo $a->get('headline|title'); ?>" border="0" /></a> <?php } else { ?> <img src="<?php echo base_url().$a->featured_image->url; ?>" alt="<?php echo $a->get('headline|title'); ?>" border="0" /> <?php } ?> </td> <td valign="top"><p style="font-family: Arial, sans-serif; font-size: 13px; color: #555555; line-height: 16px; margin-top: 0; margin-bottom: 10px;"><?php echo (trim($a->summary)) ? $a->summary.$suffix : truncate($a->body, 250, '..'.$suffix); ?></p></td> </tr> </table> <?php } else { ?> <p style="font-family: Arial, sans-serif; font-size: 13px; color: #555555; line-height: 16px; margin-top: 0; margin-bottom: 10px;"><?php echo (trim($a->summary)) ? $a->summary.$suffix : truncate($a->body, 250, '..'.$suffix); ?></p> <?php } ?> <?php // Reset the output formatting to false (original) $a->setOutputFormatting(false); ?> </td> </tr> </table> <?php } } ?>
  6. Well if I try to comment out the setOutputFormatting calls like this: //$page->setOutputFormatting(true); $exact_target_email_body = $page->render(); //$page->setOutputFormatting(false); Then it produces this error in my module when I try to save the page: Page /emails/test-email/ may not be rendered because outputFormatting is set to false. Call $page->setOutputFormatting(true) before rendering the page. It runs fine when I uncomment those lines and save but like mentioned above the "$exact_target_email_body" variable that saves the html for that page only has the path to where the images are stored but does not include the filename itself.
  7. Also note that I have to do this call to actually render the page and put it in a variable: $page->setOutputFormatting(true); $exact_target_email_body = $page->render(); $page->setOutputFormatting(false);
  8. So we have a project setup that has added a module that uses the addHookAfter('save') functionality. Essentially the goal is after a we actually "Save" the page options in the backend of PW we grab specific fields we have created and do an API call to an email service which includes doing a $page->render() to grab the full html for the page we are editing and send that along as the body of that email. The issue I am seeing when I actually view the page via the browser there are images that are showing correctly from a loop of articles but when I do the render I am only getting the path to the image like for example if the image url is: /site/assets/files/2123/feature_car.jpg I am only getting via the $page->render() instead of the full path: /site/assets/files/2123/ The section that this is happening is running a loop on articles inside of the template file and is causing the error is similar to this. The problem is happening with this part of the code: <?php echo base_url().$a->featured_image->url; ?> Heres the overall code: <?php $related_articles = $pages->get(1007)->children("template=article,is_national=1,related_edition={$pages->get(1021)->related_edition},related_categories!={$pages->get(1132)},sort=-date,include=all"); if ($related_articles->count()) { foreach ($related_articles as $a) { ?> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td> <a href="<?php echo base_url().$a->url; ?>" title="Learn More: <?php echo $a->title; ?>" target="_blank"><?php echo ($a->headline != '') ? $a->getUnformatted("headline") : $a->title; ?></a> <?php $suffix = ' <a href="'.base_url().$a->url.'" target="_blank" style="text-decoration: none;" title="Learn More: '.$a->get->title.'">Learn More »</a>'; if ($a->featured_image) { ?> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom: 10px;"> <tr> <td> <?php if ($a->featured_image->url->description != '') { ?> <a href="<?php echo $a->featured_image->url->description; ?>" title="<?php echo $a->get('headline|title'); ?>"><img src="<?php echo base_url().$a->featured_image->url; ?>" alt="<?php echo $a->get('headline|title'); ?>" border="0" /></a> <?php } else { ?> <img src="<?php echo base_url().$a->featured_image->url; ?>" alt="<?php echo $a->get('headline|title'); ?>" border="0" /> <?php } ?> </td> <td valign="top"><p style="font-family: Arial, sans-serif; font-size: 13px; color: #555555; line-height: 16px; margin-top: 0; margin-bottom: 10px;"><?php echo (trim($a->summary)) ? $a->summary.$suffix : truncate($a->body, 250, '..'.$suffix); ?></p></td> </tr> </table> <?php } else { ?> <p style="font-family: Arial, sans-serif; font-size: 13px; color: #555555; line-height: 16px; margin-top: 0; margin-bottom: 10px;"><?php echo (trim($a->summary)) ? $a->summary.$suffix : truncate($a->body, 250, '..'.$suffix); ?></p> <?php } ?> </td> </tr> </table> <?php } } ?>
×
×
  • Create New...