To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #448 (closed defect: fixed)

Opened 20 months ago

Last modified 13 months ago

Blog slot links does not link to blog engine page with matching category

Reported by: pgodel Owned by: tboutell
Priority: major Milestone: 1.5
Component: apostropheBlogPlugin Version: 1.5
Keywords: 1.5rc2 Cc: johnnyoffline, team@…
Symfony version: 1.4

Description

I have 2 blog engine pages:
- /news (category news)
- /jobs (category jobs)

I also added a blog slot to show an index of blog posts and set the category to jobs. Links on this slot still point to /news/xxx

Change History

Changed 17 months ago by rickybanister

  • cc johnnyoffline, added
  • milestone set to 1.4.2

John,

Can you update this ticket with the push/ pop stuff Dan created?

Changed 17 months ago by johnnyoffline

  • status changed from new to closed
  • resolution set to fixed

Here is an example of how to use the Push/Pop? functionality to target different engine pages based on their slugs.

Any links generated in the blog posts will point to the appropriate engine page in between the push/pop example below:

<div class="news">
  <?php aRouteTools::pushTargetEnginePage('/news') ?>
  <h3 class="news-header"><?php echo link_to('News', 'a_blog') ?></h3>
    <?php a_slot('news', 'aBlog', array(
		'template' => 'homeNewsTemplate', 
		'excerptLength' => 80,
		'slideshowOptions' => array(
			'width' => 240, 
			'height' => 160,
			'resizeType' => 'c',
	))) ?>
  <?php aRouteTools::popTargetEnginePage('aBlog') ?>	
</div>

<div class="jobs">
  <?php aRouteTools::pushTargetEnginePage('/jobs') ?>	
  <h3 class="jobs-header"><?php echo link_to('Jobs', '/jobs') ?></h3>
    <?php a_slot('jobs', 'aBlog', array(
		'template' => 'homeJobsTemplate', 
		'excerptLength' => 60,
		'slideshowOptions' => array(
			'width' => 150, 
			'flexHeight' => true,
			'resizeType' => 's',
	))) ?>
  <?php aRouteTools::popTargetEnginePage('aBlog') ?>
</div>

Changed 17 months ago by johnnyoffline

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 17 months ago by johnnyoffline

  • owner changed from dordille to rickybanister
  • status changed from reopened to assigned

Should Dana track down any documentation in the Trac Wiki that might exist on this and grab the above documentation and add it to it?

Changed 17 months ago by rickybanister

  • owner changed from rickybanister to Dana

John, that makes sense.

Changed 15 months ago by Dana

  • keywords 1.5b added
  • owner changed from Dana to dordille
  • version set to 1.5
  • milestone changed from 1.4.2 to 1.5

Please review to see if this is working in 1.4 and 1.5.

Changed 15 months ago by geoffd

  • owner changed from dordille to tboutell

Changed 15 months ago by geoffd

  • cc team@… added; removed

The workaround above is not acceptable. Front-end devs should not have to push and pop hard paths to pages. Some reasonable best engine page algorithm should be applied.

Changed 15 months ago by geoffd

  • keywords 1.5rc2 added; 1.5b removed

Changed 14 months ago by tboutell

This is related to [145].

Changed 13 months ago by tboutell

  • status changed from assigned to closed
  • resolution set to fixed

A blog posts slot with a post in the jobs category will now link to the jobs-specific engine page.

The aDoctrineRoute class now automatically calls getEngineSlug on the sf_subject (the object the link is for), if that method exists. So far in my tests this looks like a solid fix to the longstanding problem of generating decent permalinks for blog and event slots.

This is done only if we are not already on an engine page of the relevant type (for instance you are never taken away from the /blog engine page when you click on a permalink for something shown there, even if it's even better for the /job page).

Also you are never taken away from an engine page that has been explicitly pushed or set with the engine-slug parameter.

Changed 13 months ago by tboutell

The fix is in [2964]

Note: See TracTickets for help on using tickets.