Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter Zax

    (@zax007)

    That’s what I hinted in one of my previous posts here that it wouldn’t make sense adding hero related arguments to header action but you said that you would be adding it anyway.

    Either way, thanks for suggestion, that’s what I was using for a while now.

    Thread Starter Zax

    (@zax007)

    Thanks for adding $type argument to blocksy:hero:after (and blocksy:hero:before) in latest update. Unfortunately blocksy:header:after doesn’t seem to be covered by this change, is it still planned?

    Thread Starter Zax

    (@zax007)

    Wow, sorry I was checking all posts on first page during the last few days, no idea how I could’ve missed it. Feel free to mark it as resolved.

    Thread Starter Zax

    (@zax007)

    I understood that the HEADER action wouldn’t be called when HERO is disabled but if its not the case then its fine.

    I don’t call the hero action when hero is disabled, although from what see in code the title with meta is considered “hero” internally, so type-1 is “disabled” and type-2 enabled, its never truly disabled? Sorry to bother you with these questions.

    Any ETA when we can expect next update? Weeks, days, month?

    Thread Starter Zax

    (@zax007)

    So both blocksy:header:after and blocksy:hero:after will have hero-type passed as argument? Out of curiosity, why blocksy:header:after (header) wouldn’t be called when hero is disabled? Can hero be even disabled or type-1 means disabled (visually)?

    PS. About default values, what I meant is that the default values are usually hardcoded or read from settings (in programming in general) so you, as the framework author have the access to these values but I don’t. I would be guessing what hero-type is default for what page because I have no means to access that data, other than reading your code and hardcoding these values myself.

    Thread Starter Zax

    (@zax007)

    1. I checked the result of blocksy_get_page_title_source and it wasn’t null, at least for search and blog pages. These are some returned values (it returns customizer even though I wasn’t in customizer, not sure if intended):

    customizer,single_page
    customizer,single_blog_post
    customizer,blog
    customizer,search
    customizer,categories

    The last 3 page types (blog, search, categories) returned NULL hero-type. All examples returned the correct hero-type in customizer. The page title was enabled for all of them, disabling page title makes it return NULL everywhere even in customizer.

    2. I can’t rely on default return value here because it would be pure guessing (I can’t predict if some random blog post wasn’t set to different type) – correct me if I’m wrong please.

    I need some reliable method that works with unique pages, blog, search, archive etc. All my test results were with page titles enabled BUT I plan to have title disabled for some random pages, is there no way to get the correct result if “page title is disabled”?

    3. Hero type as an argument to the blocksy:hero:after action could work but I’m also using blocksy:header:after and it wouldn’t make sense adding hero-type to some unrelated header action/event?

    add_action('blocksy:header:after', 'add_content_after_header', 20);
    
    function add_content_after_header() {
    
    	$type = blocksy_akg_or_customizer('hero_section', blocksy_get_page_title_source());
    	
    	if ($type == 'type-1') {	
    		$breadcrumbs_builder = new Blocksy_Breadcrumbs_Builder();
    		echo $breadcrumbs_builder->render();	
    	}
    }
    
    add_action('blocksy:hero:after', 'add_content_after_hero', 20);
    
    function add_content_after_hero() {
    
    	$type = blocksy_akg_or_customizer('hero_section', blocksy_get_page_title_source());
    	
    	if ($type == 'type-2') {	
    		$breadcrumbs_builder = new Blocksy_Breadcrumbs_Builder();
    		echo $breadcrumbs_builder->render();	
    	}
    }

    If page name is inaccessible by other means (with page title is disabled), perhaps adding page-title as additional argument for some events would make more sense?

    Thread Starter Zax

    (@zax007)

    Done but no answer yet, so can’t say if its bug or something on my end.

    Thread Starter Zax

    (@zax007)

    Exactly what I needed, thanks! Added padding-top: 20px and it looks good now.

    I modified the code snippet from my first post to only work on type-2 style:

    add_action('blocksy:hero:after', 'add_content_after_hero', 20);
    
    function add_content_after_hero() {
    
    	$type = blocksy_akg_or_customizer('hero_section', blocksy_get_page_title_source());
    	
    	if ($type == 'type-2') {	
    		$breadcrumbs_builder = new Blocksy_Breadcrumbs_Builder();
    		echo $breadcrumbs_builder->render();	
    	}
    }

    Wondering if it wouldn’t be better to generate breadcrumbs for type-1 separately on different action/event? blocksy:head:end ? Not sure how it would work with sticky header though.

    Thread Starter Zax

    (@zax007)

    @creativethemeshq

    Unfortunately its hosted locally so can’t post the link but generally I’m trying to achieve breadcrumbs placed in this position: https://imgur.com/a/yI8Jav2 – it seems to be the most popular breadcrumbs placement on most pages today(?)

    blocksy:hero:after – places them exactly here but all the way left (full width)
    blocksy:single:top – good but its same row as sidebar not above
    blocksy:content:before – its before the hero section, so nope

    Thread Starter Zax

    (@zax007)

    Hey, this isn’t “blocks hooking” feature available in pro version. I’m just hooking manually with code snippets by registering to actions. 🙂

    Thread Starter Zax

    (@zax007)

    I forgot to mention that I’m using style 2 of hero section (with featured image as background and transparent header. So with “blocksy:content:before” it goes on top of whole page, behind the header.

    What I’ve tried so far is:

    • blocksy:single:top
      blocksy:single:content:top
    • both place it on top of page text but it doesn’t go above left sidebar.

    • blocksy:hero:after
    • this is just below hero but uses the width of hero which is full page in style 2 and I need it to be the same width as ct-container.

      Any suggestions?

    Thread Starter Zax

    (@zax007)

    Yes thanks, its fixed in latest update.

    Thread Starter Zax

    (@zax007)

    I noticed that it happens only on main BLOG page, nested Breadcrumbs on each individual posts has the correct custom blog page name, ie: Home > News > Post

    I fixed this issue with this code snippet:

    add_filter(
    	'blocksy:breadcrumbs:items-array',
    	function ($items) {
    		if (blocksy_is_page()) {
    			$items[1]['name'] = get_queried_object()->post_title;
    			return $items;
    		}
    		return $items;
    	}
    );
    • This reply was modified 3 years, 9 months ago by Zax.
    Thread Starter Zax

    (@zax007)

    Thanks, I will most likely use your second answer as workaround (hopefully temporarily), but I think that its more of a bug than feature and should be passed to dev team for fixing.

    For example switching to Breadcrumb NavXT engine detects the page name correctly, but I would rather not use additional dependencies.

Viewing 14 replies - 1 through 14 (of 14 total)