Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #15417

    Hi,

    I use Flagship.

    I can’t find a way to set a default dynamic template for posts.

    Sure, when I make a post then I can set the dynamic template, but that doesn’t work for me, because then posts aren’t made within WordPress, but f.i. with MarsEdit.

    Can you please help me out?

    Greetings,

    Ron

    #87416

    Hi Ron,

    You may select dynamic templates for both posts and pages on the bottom right side of the add new/edit posts/pages in Flagship backend. I’ve never used MarsEdit,and unfortunately don’t own a Mac to test it. I think your best bet is to contact MarsEdit support forum, since most blogging software allows the user to declare custom form fields within the blogging software itself.

    Thanks,

    Nick

    #87417

    Hi Nick,

    thanks for your kind reply.

    My problem is not about MarsEdit and I know that I can set the dynamic template in the post.

    The point is, that posts are not made within the WordPress environment, but from the outside.

    For my pages to show up correctly, I need posts to have a default dynamic template.

    Is there a way to set the dynamic template for posts?

    How can I make my question a support question, because this issue makes the difference for me for going live with the website or not.

    Thanks,

    Ron

    #87418

    Hi!

    No, posts do not support dynamic templates at the moment.

    Best regards,

    Peter

    #87419

    Hi Dude,

    as far as I can see (and tried) posts do support dynamic templates.

    But I have to select it in every post and I want a post to have a default value.

    Can I hardcode this value in php?

    Thanks in advance,

    Ron

    #87420

    Yep, sry – I mistakenly read “Flashlight” instead of “Flagship”. Go to flagshipincludesadminregister-admin-metabox.php and replace:

    "std" 	=> "",
    "no_first"=>true,
    "subtype" => array( 'Use default' => "",
    'left sidebar' =>'sidebar_left',
    'right sidebar'=>'sidebar_right',
    'no sidebar'=>'fullsize',
    'Dynamic Template'=>'dynamic'
    )),

    with:

    "std" 	=> 'dynamic',
    "no_first"=>true,
    "subtype" => array( 'Use default' => "",
    'left sidebar' =>'sidebar_left',
    'right sidebar'=>'sidebar_right',
    'no sidebar'=>'fullsize',
    'Dynamic Template'=>'dynamic'
    )),

    In the next array search for:

    "std" 	=> "",
    "required" => array('layout','{contains}dynamic'),

    and insert the template value as standard.

    #87421

    Hi Dude,

    thanks for your reply.

    I did what you said but without any result.

    On line 106 I pasted your code. As far as I can see the only difference is the word “dynamic” behind ‘std’.

    Then in the next array on line 121 I placed the name off my template (basis) behind ‘std’.

    This looks like: “std” => “basis”,

    But it hasn’t got any effect.

    Any suggestion?

    Ron

    #87422

    Maybe the “old” default option is still stored in the database. Afaik Kriesi’s framework reads the meta box option arrays and stores them into the wp_postmeta database table. The meta_key is “_avia_elements_avia_options_THEMENAME” – thus in this case it should be “_avia_elements_avia_options_flagship”. Try to delete this meta key entry – this will force flagship to rewrite the data. In addition this code change won’t affect existing post entries because the default value will only be used if no option value was set before.

    #87423

    Hi Dude,

    the way I see it, is that this setting you gave sets the default value for creating a post within WordPress.

    After this change, if I make a post in WordPress, the defaults are set to the correct values.

    But what I want, is that every post I create, also from outside WordPress, gets the correct dynamic page settings.

    So where on the wrong trail ….

    Any more suggestions?

    Ron

    #87424

    Tbh I’m not sure if this is possible. Flagship stores the template as meta value (aka “custom field”) for each post/page and you’d need to set a custom field with the key “_avia_elements_avia_options_flagship” and the value:

    array( 'layout' => 'dynamic' , 'dynamic_templates' => 'basis' )

    I’m not sure if MarsEdit supports custom fields and if you can set arrays as custom field values…

    #87425

    That’s not possible in MarsEdit and that’s not very user-friendly for my customers also.

    And MarsEdit is only an example.

    I hoped that I could set the template in the code somewhere.

    If that’s not possible then I can’t work with this template.

    Is there a template that his this possibility?

    #87426

    Hey!

    No, unfortunately not because all our themes/templates use post meta to store this kind of data.

    Regards,

    Peter

    #87427

    Hey Dude,

    I solved it by making a trigger in MySQL.

    Thanks for your help!

    Regards,

    Ron

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘dynamic template in post’ is closed to new replies.