Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Single page templates
New Landing › How can we help? › Themeforest Theme Support › Dante › Single page templates
- This topic has 11 replies, 4 voices, and was last updated 10 years by Mohammad – SUPPORT.
-
Posted in: Dante
-
February 11, 2014 at 2:34 pm #47990
Is there any way to edit a simple page like the “default page sidebar right” example based on a page template instead of having to write it with the theme short codes?
If not, what is the default HTML markup that I have to set in order to have a page template like that?
And for a table like the Striped Minimal Table?February 13, 2014 at 7:50 am #48496Hi,
I am not sure if i understand what exactly are you trying to achieve . Could you please elaborate ?. Do you want to not use the builder and hardcode the page html ?.-Tahir
February 13, 2014 at 9:54 pm #48848Yes.
I want to have a theme page template that I can select on the WordPress page editor and it shows up the page title and content as in the “default page sidebar right” example.
February 18, 2014 at 7:58 am #49840Hi, that’s not possible at the moment because we have a built in page builder that lets you build custom templates, therefor we don’t utilize the page templates for that as well.
Cheers!
February 19, 2014 at 8:28 am #50147Ok.
But if I want to use the page templates for that (I don’t know if there’s any inconvenient that I don’t know about doing that), could you please indicate me what is the HTML markup that I have to use in the template?
I figure out that, in essence, the page builder only translate some shortcodes into HTML markup, so I only want to put this markup directly on a template :-/
February 21, 2014 at 1:44 pm #50885Hey, you would choose a page as a model basically and copy that over. It’s a BUNCH of code to copy just to have a bare boned skeleton page template to edit from. But you could go from page.php and create a page template from that.
Cheers
September 24, 2014 at 6:23 pm #114183Hi again (after some time ago 🙂 ).
Finally I could workaround that.
I was willing to make that in order to use the Advanced Custom Fields plugin in order to make the baseball team roster. Now, you can see it here: http://beisbolsantboi.com/rosters/senior/
I’ve created a template with the following code:
<?php /* Template Name: Roster */ ?> <?php get_header(); ?> <?php $options = get_option('sf_dante_options'); $default_show_page_heading = $options['default_show_page_heading']; $default_page_heading_bg_alt = $options['default_page_heading_bg_alt']; $default_sidebar_config = $options['default_sidebar_config']; $default_left_sidebar = $options['default_left_sidebar']; $default_right_sidebar = $options['default_right_sidebar']; $pb_active = sf_get_post_meta($post->ID, '_spb_js_status', true); $show_page_title = sf_get_post_meta($post->ID, 'sf_page_title', true); $page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true); $page_title = sf_get_post_meta($post->ID, 'sf_page_title_one', true); $page_subtitle = sf_get_post_meta($post->ID, 'sf_page_subtitle', true); $page_title_bg = sf_get_post_meta($post->ID, 'sf_page_title_bg', true); $fancy_title_image = rwmb_meta('sf_page_title_image', 'type=image&size=full'); $page_title_text_style = sf_get_post_meta($post->ID, 'sf_page_title_text_style', true); $fancy_title_image_url = ""; if ($show_page_title == "") { $show_page_title = $default_show_page_heading; } if ($page_title_bg == "") { $page_title_bg = $default_page_heading_bg_alt; } if ($page_title == "") { $page_title = get_the_title(); } foreach ($fancy_title_image as $detail_image) { $fancy_title_image_url = $detail_image['url']; break; } if (!$fancy_title_image) { $fancy_title_image = get_post_thumbnail_id(); $fancy_title_image_url = wp_get_attachment_url( $fancy_title_image, 'full' ); } $sidebar_config = sf_get_post_meta($post->ID, 'sf_sidebar_config', true); $left_sidebar = sf_get_post_meta($post->ID, 'sf_left_sidebar', true); $right_sidebar = sf_get_post_meta($post->ID, 'sf_right_sidebar', true); if ($sidebar_config == "") { $sidebar_config = $default_sidebar_config; } if ($left_sidebar == "") { $left_sidebar = $default_left_sidebar; } if ($right_sidebar == "") { $right_sidebar = $default_right_sidebar; } sf_set_sidebar_global($sidebar_config); $page_wrap_class = ''; if ($sidebar_config == "left-sidebar") { $page_wrap_class = 'has-left-sidebar has-one-sidebar row'; } else if ($sidebar_config == "right-sidebar") { $page_wrap_class = 'has-right-sidebar has-one-sidebar row'; } else if ($sidebar_config == "both-sidebars") { $page_wrap_class = 'has-both-sidebars row'; } else { $page_wrap_class = 'has-no-sidebar'; } $remove_breadcrumbs = sf_get_post_meta($post->ID, 'sf_no_breadcrumbs', true); $remove_bottom_spacing = sf_get_post_meta($post->ID, 'sf_no_bottom_spacing', true); $remove_top_spacing = sf_get_post_meta($post->ID, 'sf_no_top_spacing', true); if ($remove_bottom_spacing) { $page_wrap_class .= ' no-bottom-spacing'; } if ($remove_top_spacing) { $page_wrap_class .= ' no-top-spacing'; } ?> <?php if ($show_page_title) { ?> <div class="container"> <div class="row"> <?php if ($page_title_style == "fancy") { ?> <?php if ($fancy_title_image_url != "") { ?> <div class="page-heading fancy-heading col-sm-12 clearfix alt-bg <?php echo $page_title_text_style; ?>-style fancy-image" style="background-image: url(<?php echo $fancy_title_image_url; ?>);"> <?php } else { ?> <div class="page-heading fancy-heading col-sm-12 clearfix alt-bg <?php echo $page_title_bg; ?>"> <?php } ?> <div class="heading-text"> <h1 class="entry-title"><?php echo $page_title; ?></h1> <?php if ($page_subtitle) { ?> <h3><?php echo $page_subtitle; ?></h3> <?php } ?> </div> </div> <?php } else { ?> <div class="page-heading col-sm-12 clearfix alt-bg <?php echo $page_title_bg; ?>"> <div class="heading-text"> <h1 class="entry-title"><?php echo $page_title; ?></h1> </div> <?php // BREADCRUMBS if (!$remove_breadcrumbs) { echo sf_breadcrumbs(); } ?> </div> <?php } ?> </div> </div> <?php } ?> <?php if ($sidebar_config != "no-sidebars" || $pb_active != "true") { ?> <div class="container"> <?php } ?> <div class="inner-page-wrap <?php echo $page_wrap_class; ?> clearfix"> <?php if (have_posts()) : the_post(); ?> <!-- OPEN page --> <?php if (($sidebar_config == "left-sidebar") || ($sidebar_config == "right-sidebar")) { ?> <div <?php post_class('clearfix col-sm-8'); ?> id="<?php the_ID(); ?>"> <?php } else if ($sidebar_config == "both-sidebars") { ?> <div <?php post_class('clearfix col-sm-9'); ?> id="<?php the_ID(); ?>"> <?php } else { ?> <div <?php post_class('clearfix'); ?> id="<?php the_ID(); ?>"> <?php } ?> <?php if ($sidebar_config == "both-sidebars") { ?> <div class="row"> <div class="page-content col-sm-8"> <?php the_content(); ?> <div class="link-pages"><?php wp_link_pages(); ?></div> <?php if ( comments_open() ) { ?> <div id="comment-area"> <?php comments_template('', true); ?> </div> <?php } ?> </div> <aside class="sidebar left-sidebar col-sm-4"> <?php dynamic_sidebar($left_sidebar); ?> </aside> </div> <?php } else { ?> <div class="page-content clearfix"> <?php $jugadores = get_field('jugadores'); if( $jugadores ) { ?> <table id="roster"> <thead> <tr> <th><strong>Foto</strong></th> <th><strong>Nombre</strong></th> <th><strong>Dorsal</strong></th> <th><strong>Fecha de nacimiento</strong></th> </tr> </thead> <tfoot> <tr> <td colspan='7'><strong>Número total de jugadores:</strong></td> <td><?php echo count( $jugadores ); ?></td> </tr> </tfoot> <tbody> <?php foreach( $jugadores as $jugador ) { $fecha_nacimiento = DateTime::createFromFormat( 'Ymd', $jugador['fecha_de_nacimiento'] ); echo "<tr>"; echo "<td>"; if (!empty($jugador['foto'])) { echo "<a href='" . $jugador['foto']['sizes']['large'] . "'><img alt='$jugador[nombre]' src='" . $jugador['foto']['sizes']['thumbnail'] . "' width='60' height='60' /></a>"; } echo "</td>"; echo "<td>$jugador[nombre]</td>"; echo "<td>$jugador[dorsal]</td>"; echo "<td>" . $fecha_nacimiento->format('d-m-Y') . "</td>"; echo "</tr>"; } ?> </tbody> </table> <?php } ?> <div class="link-pages"><?php wp_link_pages(); ?></div> <?php echo sharing_display(); ?> <?php if ( comments_open() ) { ?> <div id="comment-area"> <?php comments_template('', true); ?> </div> <?php } ?> </div> <?php } ?> <!-- CLOSE page --> </div> <?php endif; ?> <?php if ($sidebar_config == "left-sidebar") { ?> <aside class="sidebar left-sidebar col-sm-4"> <?php dynamic_sidebar($left_sidebar); ?> </aside> <?php } else if ($sidebar_config == "right-sidebar") { ?> <aside class="sidebar right-sidebar col-sm-4"> <?php dynamic_sidebar($right_sidebar); ?> </aside> <?php } else if ($sidebar_config == "both-sidebars") { ?> <aside class="sidebar right-sidebar col-sm-3"> <?php dynamic_sidebar($right_sidebar); ?> </aside> <?php } ?> <?php if ($sidebar_config != "no-sidebars" || $pb_active != "true") { ?> </div> <?php } ?> <!--// WordPress Hook //--> <?php get_footer(); ?>
Do you find it correct?
Can I improve it in anyway?For example, I’ve had to “hardcode” the apperance of the JetPack social sharing options with the sharing_display(); function, but I don’t know if there’s any kind of WordPress hook for that.
Thanks!
September 25, 2014 at 7:39 am #114318Hi,
Good work and thanks for sharing code.
Thanks 🙂
With Best Regards
MohammadSeptember 25, 2014 at 7:45 am #114320Hi, thanks for your comments 🙂
What about the doubts?
Do you find it correct?
Can I improve it in anyway?For example, I’ve had to “hardcode” the appearance of the JetPack social sharing options with the sharing_display(); function, but I don’t know if there’s any kind of WordPress hook for that.
Thanks!
September 25, 2014 at 4:55 pm #114613Hi,
I see your code correct and no need to improve. You did good customization. There is no need for wordpress hook. Just make simple change in code.Find this code:- <?php echo sharing_display(); ?> Change to:- <?php if(function_exists('sharing_display')){ echo sharing_display(); } ?>
Thanks
September 26, 2014 at 9:10 am #114786Done, thanks!
September 26, 2014 at 9:13 am #114788Hi,
You most welcome.
Thanks 🙂
With Best Regards
Mohammad -
Posted in: Dante
You must be logged in and have valid license to reply to this topic.