Feature #19169

Integrate hook in page module to render preview of records with own CType

Added by Oliver Hader over 11 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2008-07-30
Due date:
% Done:

0%

PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

The method tt_content_drawItem in tx_cms_layout (page module view) renders a preview for each defined CType, like header, text, textpic, etc. If an own CType is used, e.g. "tx_myext_pi1", the bodytext field is rendered by default and nothing less or more.

A solution for individual CTypes would be to introduce a hook that is able to render the preview of the accordant record.

In general the page module would be happy with kind of refactoring... ;-)
(issue imported from #M9078)

0009078.patch View (1.16 KB) Administrator Admin, 2008-07-30 16:12

0009078_v2.diff View (14.7 KB) Administrator Admin, 2008-08-12 17:46

History

#1 Updated by Ingo Renner over 11 years ago

such a hook already exists

#2 Updated by Oliver Hader over 11 years ago

What the... Am I blind? Which one do you talk about?

#3 Updated by Ingo Renner over 11 years ago

I don't remember the name but there's a way for plugins to change what to show instead of the old "CODE". I think that one should do. I'd say check Dmitry's extensions he's using it AFAIR.

#4 Updated by Oliver Hader over 11 years ago

Maybe you refer to the hook for CEs of the CType "list" - there's a hook, that's right, but not for individual new CTypes.

#5 Updated by Ingo Renner over 11 years ago

yes, that's the one I mean

#6 Updated by Oliver Hader over 11 years ago

I just created a new version of the patch that changes the following:
  • the hook is not only for individual CTypes anymore
  • the hook does a pre-proecessing before the regular processing of tx_cms_layout->tt_content_drawItem() - this one can be disabled by the hook ($drawItem) - the "if ($drawItem)" is just wrapped around the existing switch with no further changes there

#7 Updated by Oliver Hader over 10 years ago

Committed to SVN Trunk (rev. 5173)

Also available in: Atom PDF