That was the initial thought and after I accomplished this I realized we don't need a quick fix here and that I'd be more satisfied if Extra Content made to show up on homepage wouldn't show up on admin pages, wouldn't you agree?
Now, let's just say this was a bit confusing and I've been looking at 'case' lines in original extra function all along but the solucija was lying somewhere else...
Let's look at some facts first (was working with original Extra Content from sNews here):
Fact 1: created Extra Content to show on Home category
Fact 2: Extra Content now has position value 210 and category value 0
Fact 3: Extra Content shows on the following pages: homepage, Articles and Pages under home category & of course on all hard-coded pages
Fact 4: Mika's explanation from snews-commented.php says that if the position value starts with '21', then that's a category dependent Extra Content
For me, when I created and applied this mod it made sense that if I wanted to show a category introductory text, it should not be visible on all the pages 'below' that category as well. So I modified my extra function a bit more which is explained here
as another mod.
Now, it looks like I covered all the cases but the case when the category that an extra content is dependent on is Home category. Reason for this is that I didn't know how to do it. Ha! :/
Fact 5: applying this other mod
makes the Extra content show on the following pages: homepage, all hard-coded pages BUT not on Articles and Pages 'below' the Home category
I guess my other mod does work in some extent, it's just that I disregarded the hard-coded pages, which should be treated the same as Article and Pages (this is not going to sNews developers, as it's valid just for this modification) and that is if I want to show extra content on category index page, just as on the Homepage, I don't want it to be visible on other pages below that category (including other Articles, Pages and all hard-coded pages).
The 'problem' lies here:
$categoryId variable inside extra function is set to '0' whether the page is hard-coded or "home", either way. Basically, that way extra function sees hard-coded pages as if they were the Homepage. We need to set $categoryId to '0' ONLY when category is home:
Find this line inside your extra function:
$categoryId = (check_category($categorySEF) == true || empty($categorySEF) || $categorySEF == s('home_sef')) ? 0 : retrieve('id', 'categories', 'seftitle', $categorySEF);
And replace it with the following one:
$categoryId = (empty($categorySEF) || $categorySEF == s('home_sef')) ? 0 : retrieve('id', 'categories', 'seftitle', $categorySEF);
Fact 6: when I apply the above solucija, Extra content shows on the following pages, hmm, on the following page: homepage - success! Finally.
Question 1: Does this have any other side effects on the way extra function should work? I haven't seen any so far.