0

I can only trigger the 404 template for anything more than two segments, for example, if this is bad link I see 404 page: site.com/wrong/link

When just accessing one segment like this for example, site.com/wrong page displays my listing entry template outputting same entry.

Here's template...maybe something on there or route that isn't set up correctly?

{embed="layouts/index"}

{exp:stash:set parse_tags="yes"}
        {stash:content}
            <div id="subpage-container" class="content">
                <table class="Subsection-Image-Table" style="background-image: url('/assets/images/header-background.jpg');">
                    <tbody>
                        <tr>
                            <td>
                            <!--
                                <table width="100%">
                                    <tbody>
                                        <tr>
                                            <td style="width: 50%;" width="50%">
                                                <h1>Personal Checking</h1>
                                                <p>This outer table (with a green outline in cms) is a table with class "<em>Subsection-Image-Table</em>". To change the image of a page with this table, select the table, right click, choose "Table Properties" and choose an image from the background image select box.</p>
                                            </td>
                                            <td width="50%">&nbsp;</td>
                                        </tr>
                                    </tbody>
                                </table>
                                -->
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table class="Subsection-Table">
                    <tbody>
                        <tr>
                            <td>
                                <h1><a href="{homepage}">Blog</a></h1>
                                <div class="row">

                                        {embed="embeds/_sidebar"}

                                    <div class="col-md-9 entry-listing">
                                        {exp:channel:entries channel="blog_entry" orderby="date" limit="1"}
                                            <div class="col-right">
                                                <ul class="breadcrumbs">
                                                    <li><a href="{homepage}">Blog Home</a></li> 
                                                    <li>{title}</li>
                                                </ul>
                                                <article class="text-area">
                                                    <h1>{title}</h1>
                                                    <div class="owl-carousel owl-theme">
                                                        {blog_entry_images}
                                                            <div>
                                                                <img class="blog-image" src="{blog_entry_images:image}" alt="{alt}" style="margin-bottom:0;"/>
                                                                {if blog_entry_images:caption}<p class="blog-caption">{blog_entry_images:caption}</p>{/if}
                                                            </div>
                                                        {/blog_entry_images}
                                                    </div>
                                                    <span class="posted">Published on {entry_date format='%M %j, %Y'}</span>
                                                    {embed="embeds/_sharing_icons"}
                                                    {blog_entry_blocks}
                                                        {vimeo_embed}
                                                        <div class="videoWrapper">
                                                            {embed}
                                                        </div>
                                                        {/vimeo_embed}

                                                        {block_content}
                                                            {content}
                                                        {/block_content}
                                                    {/blog_entry_blocks}
                                                </article>
                                            </div>
                                        {/exp:channel:entries}  
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table class="Subsection-Image-Table" style="background-image: url('/assets/images/footer-background.jpg');">
                    <tbody>
                        <tr>
                            <td>
                                <!--
                                <table width="100%">
                                    <tbody>
                                        <tr>
                                            <td width="50%">
                                                <h2><a id="Smart-Checking"></a>Heading 2</h2>
                                                <p>A table with the class "Subsection-Image-Table" can be used throughout the site in different locations. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam magna purus, dapibus vel luctus id, efficitur sed nibh. Pellentesque sit amet elit imperdiet, pharetra ipsum non, eleifend metus.</p>
                                            </td>
                                            <td width="50%">&nbsp;</td>
                                        </tr>
                                    </tbody>
                                </table>
                                -->
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div><!--/subpage-container-->

        {/stash:content}

{/exp:stash:set}

Here's my route setup: enter image description here

  • You'll need to provide some information about what your template / routes actually look like - your posting here indicates that whatever is in 'layouts/index' is part of your template output - not just this stash tag. Likewise if you are using Template Routes you need to let us know what the route settings actually are. Based on what you are reporting, I'd think it most likely that there is something wrong with your template route settings rather than being template based. – JCOGS Design Jan 19 '17 at 17:55
  • I added a screenshot above. – frshjb373 Jan 20 '17 at 21:41
  • Probably worth noting: I'm using Structure addon. – frshjb373 Jan 20 '17 at 21:47
0

Still not entirely sure from your question what you are trying to do, or how the template excerpt helps, but just for clarification, the template route in the screen grab will capture any URL that happens to begin /blog/something - regardless of whatever follows it (provided the second term matches the alpha_dash character list).

Unless you have some other route set up, there appears to be no way that you can get a 404 to display for any URL that happens to begin /blog/somethingas the template route will grab these and send them to your blog-entry template.

Maybe you should think about changing the template route status for Segments Required? to yes - this will not change the route behaviour for /blog/something but will not intercept urls with more terms (so /blog/something/else wouldn't be captured by the route if you change the segments required flag.

HTH

| improve this answer | |
  • I've narrowed down to it being an issue relating to Stash addon. I haven't resolved per dev's documentation and still working on it. I'll be sure to provide update when I find solution. – frshjb373 Jan 21 '17 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.