Jump to content

[Solved] How can i change the user that created a site and the published date in the admin gui?


Marcel Epp
 Share

Recommended Posts

Hi,

i'm stuck here with a problem. I want to change the user that created a site.
And i want to change the published date time. But i can't find an option in the admin area.

Does Processwire have these options? :'(

Or is there a modul for that?

thanks

Link to comment
Share on other sites

2 hours ago, Marcel Epp said:

How can i change the published date in the admin area?

I also always create custom fields for a published date for being used on the frontend. PW's created/modified/published dates are more for "auditing" than for public display, I think. However, for the record you can do things like this:

 

  • Like 1
Link to comment
Share on other sites

One solution i thought of is to create a new datetime field like "page_published".
And when you create a new page the field get filled with the current date.
But i can't output the field like the others. I build myself a little blog.

<!-- the logic -->
<?php $blog_posts = $pages->find('template=blog-single, limit=1, sort=-created'); ?>
<?php foreach($blog_posts as $blog_post): ?>

<?php 
$blog_post_publish_date = date('d.m.Y', $blog_post->published); 
$blog_post_created_by = $blog_post->createdUser->name;
?>

But when i change $blog_post->published to $blog_post->page_published i get an empty result.
This is from the overview site from the blog.

Link to comment
Share on other sites

OK it is working now. For the overview page i used:

<p class="text-center">veröffentlicht am <?= $blog_post->page_published ?></p>

And for my single blog page i used:

<p class="text-center">veröffentlicht am <?= $page->page_published ?></p>

So creating an extra field and put this in the single blog file is like a workaround. :)

  • Like 1
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...