preview button and permalink not working

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 5, 2023   (RSS)

By Steve99 - January 5, 2023 - edited: January 5, 2023

Hi Jeff,

I've experienced this before. It's seeing the last number in url as 9999999999.

Try something like this, using the $blogPageWhere string to set your query (set from preview:num, or to use your normal page query):

if (getLastNumberInUrl() == '9999999999') { // if preview mode
$blogPreviewNum = intval( @$_REQUEST['preview:num'] );
$blogPageWhere  = "blog.num = $blogPreviewNum";
} else {
$blogPageWhere  = "blog.num='" . getLastNumberInUrl() . "'";
}

Hope this helps!

Best,
Steve

By kitsguru - January 5, 2023

Thanks Steve that did the trick, much appreciated.

Jeff Shields