Jump to content

Get the template for FieldtypePage


Hari KT
 Share

Recommended Posts

Hi Guys,

I have a $field->type instanceof FieldtypePage .

I want to know the template of the FieldtypePage .

I have tried

$template = $this->pages->get($field->parent_id)->template;

I am getting a different template than the one I really need.

$fieldpage = new Page();
// $fieldpage->template = $name;

// Is there something like without assigning template name I can save a page ?

// $fieldpage->template_id = $template_id
$fieldpage->title = 'title';
$fieldpage->body = 'body';
$fieldpage->parent_id = $field->parent_id;
$fieldpage->save();
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...