Jump to content

Is the $page->body property passed through template processing in Tracy Console?


MarcC
 Share

Recommended Posts

Hi,

Related to this thread I started recently, I wanted to follow up and check on the expected behavior for the Tracy Debugger Console.

In my template files, there was a preg_replace operation on the $page->body property. The TD Console showed the result of this template operation after executing "echo $page->body".

Is this the normal / expected behavior, as opposed to simply showing the field HTML content from the DB? The DB itself showed the unchanged HTML for the body field.

Just wanted to check since it will help me understand how to troubleshoot better next time.

Thanks! 

Link to comment
Share on other sites

Hi @MarcC - it should only work that way if you check the "Template resources" option in the Console.

If it's happening for you without that checked can you please provide the exact code you have in your template that is resulting in this.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 9/11/2024 at 4:20 PM, adrian said:

Hi @MarcC - it should only work that way if you check the "Template resources" option in the Console.

If it's happening for you without that checked can you please provide the exact code you have in your template that is resulting in this.

That's an awesome feature, I'll look into it further. Thank you.

Link to comment
Share on other sites

@MarcC - your response makes me think I didn't explain things properly because given the behavior you're seeing, I feel like you are probably already using that feature. If you're not using it, then there might be a bug causing the issue you are seeing so it would be great to know more about how you have things set up.

  • Like 1
Link to comment
Share on other sites

17 minutes ago, adrian said:

@MarcC - your response makes me think I didn't explain things properly because given the behavior you're seeing, I feel like you are probably already using that feature. If you're not using it, then there might be a bug causing the issue you are seeing so it would be great to know more about how you have things set up.

Ah, I was guessing that the feature might have been enabled by default when I installed the module, or otherwise bumped 😅.

But if not default...I kinda doubt I bumped it...

I don't see it anywhere now that I'm looking. v4.26.36, somewhere in the Console panel?

I do see references to the term "Template resources" in settings and I was able to add the separate $ panel to the front end view. That's a really helpful panel btw.

Link to comment
Share on other sites

It will appear as a checkbox on the Console when used on the frontend. Compare:

image.thumb.png.f65e7f88ea7269d4462ec5cd88009cd1.png

with:

image.thumb.png.0c0f72d82dd0c8d6063d1e99a3d29c16.png

The code in home.php is: $page->title = 'Test modify';

which only takes effect if that "Template resources" option is checked.

  • Like 1
Link to comment
Share on other sites

25 minutes ago, adrian said:

It will appear as a checkbox on the Console when used on the frontend. Compare:

...

which only takes effect if that "Template resources" option is checked.

OK, thanks! I see it now, on the front end.

I upgraded the module since my investigation, so maybe I was encountering something going on with a previous version.

I was testing on the back end, this checkbox wasn't there, and I was getting template-processed output. (Edit: I can check again just in case...)

Link to comment
Share on other sites

If you were testing on the backend, I am struggling to figure out how a template could be involved. I don't even know how it would get the code the from the template.

Can you please provide the relevant code from the template and the code you were running in the console that is causing this. Otherwise I really am just guessing :)

  • Like 2
Link to comment
Share on other sites

39 minutes ago, adrian said:

If you were testing on the backend, I am struggling to figure out how a template could be involved. I don't even know how it would get the code the from the template.

Can you please provide the relevant code from the template and the code you were running in the console that is causing this. Otherwise I really am just guessing 🙂

OK. I am going to try to reproduce first. Because it would suck to hand over to you the very simple regex-replace code which now does nothing out of the ordinary, post-the-recent-module-upgrade. 😄 And thanks again for your kind response. 👍

Link to comment
Share on other sites

On 9/12/2024 at 5:55 PM, MarcC said:

I upgraded the module since my investigation, so maybe I was encountering something going on with a previous version.

What version were you running before?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...