• frgtech

    (@frgtech)


    Hi,
    I’ve updated my site to use the new Twenty Twenty-Two block theme, and I’m trying to figure out how to style my pages associated with MEC.

    I noticed that it defaulted to using the single-post template file for all single event pages, though the formatting did not seem to adhere to the actual styling options of that template. Instead of trying to edit the single-post template and mess up what I already have there, I created a new template. “MEC Single Event”

    No matter any change I make to that template file through the site editor, nothing actually changes on the rendered page. For instance it is displaying all of my widgets even though I have none on the template.

    View post on imgur.com

    View post on imgur.com

    I have struggled to find any relevant information for block theme editing, and the default rendered page is atrocious. Could someone please direct me to a guide somewhere that will show me how to style the single event, and any other MEC pages?

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor webnus

    (@webnus)

    Hello @frgtech,

    Unfortunately, the information provided in this topic of the issue you are facing are not enough and we don’t know what happens in the end.

    Please provide these info so we can understand the issue better and help you resolve it:

    1. Detailed explanation of the issue you face; what caused it and what did you want to happen. You can attach screenshots or a short video of the issue.

    2. Explain to us step by step how we can reproduce the issue so we can recreate it somewhere other than your website.

    Before sending these, make sure that:
    Everything on your website is on the latest version (WP, theme, plugins).

    Make sure the issue is from our plugin. To do this, deactivate all other plugins then activate them one by one and check for this issue. continue doing this until you find what product is causing a conflict with MEC. Then provide the details as explained above.

    Best Regards

    nimmalareddy

    (@nimmalareddy)

    If you want to enable Full site editing, you need to modify your single-mec-events.php template in templates folder of MEC. You cannot edit in site editor.
    You need to modify theme name from “BLOCKPRESS” to your active theme name “twentytwentytwo” in the code below.
    Similar modification is needed for MEC taxonomy pages.

    <!doctype html>
    <html <?php language_attributes(); ?>>
    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    
    	<?php wp_head(); ?>
    </head>
    
    <body <?php body_class(); ?>>
    <?php wp_body_open(); ?>
    <div class="wp-site-blocks">
    <?php
    echo do_blocks( '<!-- wp:template-part {"slug":"header","theme":"blockpress","tagName":"header","className":"site-header","layout":{"inherit":true}} /-->' );
    ?>
    <main class="alignfull">
        <div>
    	  
            <section id="<?php echo apply_filters('mec_single_page_html_id', 'main-content'); ?>" class="<?php echo apply_filters('mec_single_page_html_class', 'mec-container'); ?>">
    
                <?php do_action('mec_before_main_content'); ?>
        
                <?php while(have_posts()): the_post(); ?>
        
                    <?php $MEC = MEC::instance(); echo MEC_Kses::full($MEC->single()); ?>
        
                <?php endwhile; // end of the loop. ?>
    
            </section>
        </div>
        <?php do_action('mec_after_main_content'); ?>
    
    </main>
    
    <?php
    echo do_blocks( '<!-- wp:template-part {"slug":"footer","tagName":"footer","theme":"blockpress","className":"site-footer","layout":{"inherit":true}} /-->' );?>
    
    </div>
    <?php wp_footer(); ?>
    
    </body>
    </html>

    Regarding old widgets being displayed in MEC single page, install classic widgets plugin and remove those widgets via widget screen. I don’t work for MEC, am not responsible if something goes wrong. Backup your template before making changes. Also, plugin updates will revert these changes.

    Better wait till MEC starts to provide FSE templates.

    Thread Starter frgtech

    (@frgtech)

    Thanks for the replies. I have been trying to figure this out but am still in the dark.

    A few things of note.

      The changes I make to my custom template file “MEC Single Event” are now appearing properly. I think it started working after clearing the site cache.
      Everything on my site is the absolute latest version.
      Disabling the other plugins on my site did not make any difference.
      @nimmalareddy the single-mec-events.php file in my installation looks nothing like your example. (no html code at all in mine) I tried it anyway with the suggested changes, but it did not work.

    So with my custom template working now, my biggest issue is that the countdown clock will no display. The only way to get it to show at all is by copying the single-mec-events.php file from the plugin’s templates folder and moving it into my child theme folder. Doing that makes it appear, but with even bigger issues.

    As suggested, I made a video to hopefully help show the problem easier. Below is a synopsis of what I’m doing in the video.

    Please let me know if more information is needed.

    Thanks!

      Starts with everything at default and showing the home page of the site which is badly formatted because all of the plugins are disabled.
      Then shows the plugins page with everything deactivated.
      Then shows the events page.
      Then a single event using the default template.
      The rendered page looks pretty good except the countdown clock is not shown.
      Then I show the custome template I made. It works now, but still no countdown clock.
      I then return to the default template and enable the single-mec-events.php that I copied from the plugin templates folder and placed into my child theme folder. (unaltered)
      By doing this, you can see that it changes the format of everything. It doubles nearly everything, but one of the doubled countdown clocks actually work.
      *It takes a while for the ftp to connect and enable the change in the video*
      While it’s waiting to connect, I shows the content of the single-mec-events.php file.
      I then inspect the clock (badly) to show the difference in the elements between the working lock and the other one.
      Lastly, I inspect the clock again after disabling the single-mec-events.php file in the child theme folder.

    https://drive.google.com/file/d/101isA_f0oY5aoIiGAaJmgQIWScMrjIyQ/view?usp=sharing

    ** Hopefully this is formatted correctly. Not having a preview window to check your post before posting is insidious.**

    nimmalareddy

    (@nimmalareddy)

    The code I shared is the modified template for block theme compatibility. You should copy everything and just modify theme name. Will see your video some time..
    Share your template as code if possible.

    Thread Starter frgtech

    (@frgtech)

    @nimmalareddy I tried your code again to make sure, and it doesn’t seem to have any effect on either of my custom templates. I do see some error messages when using the default template though.

    At the top of the page I get this message:
    Template part has been deleted or is unavailable: header

    At the bottom I get:
    Template part has been deleted or is unavailable: footer

    As for posting my template in code, I can’t seem to find where they are stored on my site. I also did a db search, and only found an entry under options that shows the different custom templates I created.

    _transient_autoptimize_ccss_page_templates

    a:6:{s:43:"wp-custom-template-mec-test-countdown-clock";s:24:"MEC Test Countdown Clock";s:35:"wp-custom-template-mec-single-event";s:16:"MEC Single Event";s:10:"single-mec";s:10:"single-mec";s:5:"blank";s:5:"Blank";s:17:"page-large-header";s:19:"Page (Large Header)";s:18:"page-no-separators";s:20:"Page (No Separators)";}

    If I look under my templates, I can see them there, but there are not listed as part of my child theme like the rest. “Twenty Twenty-Two (Child)

    https://drive.google.com/file/d/105VNOCzHuled65glZ86CdxZIV2keg5fn/view?usp=sharing

    I created them from inside the event editor page, so maybe that’s why.

    https://drive.google.com/file/d/10BwFy6rTGo15Z93mgS5QdhWYSCk901Oe/view?usp=sharing

    What I really need to find is the file it’s using as it’s “Default Template” I thought it was the Single-Post template, but then I realized it wasn’t. Looking through the MEC plugin directory I see some index.html files but they are all 0 bytes. Seems strange that by just copying the single-mec-events.php from the mec folder to my child theme folder would change anything. I thought that it would not change anything unless you modified the file after moving it.

    Anyway, thanks for any help!

    nimmalareddy

    (@nimmalareddy)

    It’s not supposed to be added as a custom template.. modify the original template in MEC folders..

    Thread Starter frgtech

    (@frgtech)

    @nimmalareddy
    I was off yesterday but I tried it this morning by directly modifying the single-mec-events.php file inside the MEC templates folder with your code and it didn’t change anything. (I made the suggested edits as well)

    It doesn’t seem to load the single-mec-events.php unless it has been moved into the child theme folder. If I add your code to the single-mec-events.php file in it’s original folder it appears to do nothing. In fact, if I delete single-mec-events.php from the original folder, it doesn’t change anything either.

    Once I copy/move the file to my child theme folder, I can see any changes made to the file. I already listed above the the only differences I noticed when using your code. (The missing header/footer notices)

    So when the unmodified file has been copied into my child theme folder, it doubles nearly everything as can be seen in the video I made. I am not a PHP programmer, so I’m not sure what I can try to prevent this, but it seems weird that the stock file would do this.

    I’m really out of ideas. If I could only figure out why the countdown clock will not load in any of my templates I would be done. It only works in the default template where it has two instances and only one of them works.

    Thanks for your support. I’ve tried to satisfy the requirements made by Webnus to gain further support on this issue but I’m not getting any help.

    Thread Starter frgtech

    (@frgtech)

    I managed to figure a few things out. I never considered it could be a browser issue since the countdown clock actually works when I copy the single-mec-events.php file to my child theme directory.

    What I discovered is that the clock works when I open the page in a private window. (Brave browser) Thinking it must be an extension problem, I disabled all my extensions but it did not make a difference. I then tried deleting the site cache (WP Fastest Cache), doing a hard refresh in my browser (Ctrl+Shift+r), and deleting all the site cookies. Still no joy.

    So it remains that the countdown clock does not work on my development machine in Brave, but works everywhere else that I’ve tried it. It works fine in Firefox on my machine, it works fine in Brave on multiple other machines. It works in Brave on my machine in a private windows, but will not work in a standard window with all extensions disabled.

    I’ll considered this solved as far as an issue with MEC, but I won’t turn down any suggestions on how to fix my dev browser.

    Thanks @nimmalareddy!

    nimmalareddy

    (@nimmalareddy)

    Glad that you got what you wanted finally.
    Regarding header footer issue.. Did you change the theme name in the code i gave? (without spaces)

    Now what’s your exact working setup?
    Which theme ( child theme for block theme?)
    Created templete via post edit screen?
    Did you manage to have templete for MEc taxonomy too?

    Thread Starter frgtech

    (@frgtech)

    Regarding header footer issue.. Did you change the theme name in the code i gave? (without spaces)

    I did. Changed both instances of "blockpress" -> "twentytwentytwo"

    It shouldn’t matter anymore so I wasn’t too worried about getting to the bottom of it.

    Which theme ( child theme for block theme?)

    Not exactly sure what you’re asking. I have a child theme for TwentyTwentyTwo as can be seen in the video.

    Created templete via post edit screen?

    Once I realized it was rendering fine everywhere but my machine, I deleted all of the custom templates I made via the post edit screen, and deleted the actual template file inside my child theme templates folder so I could start fresh.

    It appears to be rendering properly now using the Default template which is apparently based on the site’s single post template.

    Did you manage to have templete for MEc taxonomy too?

    I haven’t even looked at that yet. Not sure I even need it for my usage, but will look at it regardless when I get a chance.

    All the problems I had seem to be because I couldn’t see it render properly on my dev browser, and I went down the rabbit hold from there. Now that I cleared all the clutter from trying to figure it out, I’m just left with not being able to use my dev browser to develop anything further for theming. (Actually I can check my work in a private window still, but would love not to have to.)

    Maybe I’ll try and figure it out at some point, but I’ve already wasted too much time on this project for now.

    Thanks!

    • This reply was modified 2 years ago by frgtech.
    • This reply was modified 2 years ago by frgtech.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Single Event Block Theme’ is closed to new replies.