Page 1 of 1

named anchor? link content of different blocks?

Posted: Wed 2. May 2007, 10:29
by TI&OSM
How do I make 'named anchor'?

For instance I have my search form in the {HEADER},
but I want my search results to be shown in {CONTENT}?

And can I only use {HEADER}, {CONTENT}, {FOOTER}, {RIGHT} and {LEFT} or are there more than 5 block you can define?

Robert [TI&OSM]

Posted: Wed 2. May 2007, 11:09
by update
there is the possibility to create so called "custom blocks" in admin/page layout: custom:blocks. Just have a look and put in some BLOCK1, BLOCK2....
Then you will have these in your admin/templates section. Now insert {BLOCK1}... into your template....
This should work

claus

Posted: Wed 2. May 2007, 11:53
by TI&OSM
Thanks Claus, I like it when things are easy…!

Do you also have the answer on my other question…
How do I make 'named anchor'?

For instance I have my search form in the {HEADER},
but I want my search results to be shown in {CONTENT}?
It would be really nice, because it makes phpwcms a lot more flexible.

Thanks on forehand,

Robert [TI&OSM]

Posted: Wed 2. May 2007, 12:23
by Jensensen
Hi,

seems to be two questions. Regarding 'anchors' more information might follow...

For search forms you don't need anchors.

1) Make a new article with contenpart 'search form'
this will be even the page where all the results are listed.
so you rather place it in {CONTENT} or some of your main blocks.

2) check source code of page and copy the form code snippet.

3) paste the snippet to your templates where ever you want.

source code looks like
<form name="search" id="search" action="LINK_TO_YOUR_SEARCH_PAGE (step 1)*" method="post">
<input type="text" name="search_input_field" id="search_input_field" value="Search" />
</form>
*index.php?id=0,12,0,0,1,0 or something...

search_input_field don't change the input variables!!!

groetjes n greetz

Posted: Wed 16. May 2007, 11:16
by TI&OSM
Hello Jensensen,

Thanks for your input, it works great! Many thanks…

Yet, another question…

The search results do not have a empty line between them.
The come in a 'div', but I don't know where I can define that 'div'.
It's not the 'search_results div', it's nested in that one.

Further you can 'mark' the word you are looking after,
it is defined standard with 'em' and you can add other definitions to it,
but you can't get rid of the 'em' and that's what I do want!

Can you Jensensen or anybody help me with this?

Many thanks in advance,

Robert [TI&OSM]

Posted: Wed 16. May 2007, 16:13
by Jensensen
Hi Robert,

to modify this special <div>-tag you will need to patch some file!! so be careful, even when updating to newer versions!!!

open [v.1.3.3]:
/include/inc_front/content/cnt13.article.inc.php

line 268

Code: Select all

$s_result_list .= '<div>'.LF;
and add a CSS class e.g.
$s_result_list .= '<div class="MySpecialResultClass">'.LF;

btw, its worth to have a look for the following lines, too.

don't forget to add this class in your frontend.css!

this is, you should do to modify the <em> tag within your search results --->

.phpwcmsSearchResult em.highlight, em.highlight {
background-color: #FFFF00;
font-style:inherit;
}


remember that <em>, like <strong>, <h1> for example, is one of the most "preferred" spidering index tag for google and others. :wink:

greetz

Posted: Mon 21. May 2007, 15:13
by TI&OSM
Hello 'Jensensen',

Many, many thanks…!

I always wonder, how do people like you know these kind of things?!?!
Anyway, I'm glad there are people like you.

So, if I understand it well, I can change other things in all the other 'cnt**.article.inc.php', that means when I'm ready for it, technically speaking.

Many thanks again, Robert

Posted: Mon 21. May 2007, 15:44
by Jensensen
TI&OSM wrote:...So, if I understand it well, I can change other things in all the other 'cnt**.article.inc.php', that means when I'm ready for it, technically speaking...
Hi Robert,
well, indeed, yes you can, but you should better DO NOT TOUCH these files, as they are the "heart" of "our" numerously well-loved phpwcms. USUALLY there is even NO NEED to change this files. Also to do patches that way will result in MUCH MORE DIFFICULTIES, when doing updates and may run into profoundly malfunctions!!!

Otherwise it IS really worth to have a closer look to this files and somehow exciting to me. As I mentioned, this are the major program files with all the routines and stuff like that. So reading code means to learn, how the things work together hand in hand and what happens in the background. In short: to know better how phpwcms is working --> to get creativity out of the brain straight to backend and then, finally, most impressively presented in front to the public.

Greetz and happy coding

Posted: Mon 21. May 2007, 17:41
by pico
you can do it without 'hacking' the Code by wrapping it into a Div-Container by this way

make a Contentpart HTML before and after the Contentpart Search

in CP before insert <div class="yourClass">
and in CP after just </div>

so in end you have 3 CP's in the Article

HTML
SEARCH
HTML

Posted: Mon 21. May 2007, 18:39
by Jensensen
as you all can see, sometimes the things are much easier! :wink:
a little bit more effort is necessary to edit pages but a very elegant solution, pico, i didn't think about :shock:

but you will have to keep CPs in order carefully!!!!

can be very helpful i guess.
but wait, doing it this way, you have NO possibility to adjust distances (margin, padding) BETWEEN search results, isn't it?
TI&OSM wrote:Yet, another question…

The search results do not have a empty line between them.
The come in a 'div', but I don't know where I can define that 'div'.
It's not the 'search_results div', it's nested in that one.
greetz

Posted: Mon 21. May 2007, 20:49
by pico
by a little thinking and knowing how Cascading-Style-Sheets are working this is possible too

you can define Classes for every Tag in a Container

as Example

you have wrapped the Search CP into a Class named 'mySearch'
so when you take a look to the generated HTML-Sourcecode you will find something like this

Code: Select all

<div class="mySearch">
<div>
<h3><a href="index.php?id=100,53,0,0,1,0&highlight=test">Tool Tip</a></h3>
<p>and Info Pop-Up This is a short Sample how Tooltip works. - in AdminSection goto 'Keyword' and enter your Keywords for a Glossary - create a hidden Si<em class="highlight">test</em>ructure you call Keyword (for example) and with…</p>
</div>
</div>
so you can build Classes like:

.mySearch p{
font-size:18px;
background:#edcaef;
}
.mySearch a{
font-size:12px;
background:#00ff00;
}
.mySearch a:hover{
....
}


think about Parents and Childs ;)

Posted: Mon 21. May 2007, 21:21
by Jensensen
Hi pico,
you're RIGHT!
Thanks!

So, always check output, code first - then adjust CSS.

Additionally, to solve Rob's prob in this case, you can CSS the following:

.mySearch div {
padding-bottom: XYpx;
margin: Xpx 0 Yem 0;
}

.mySearch h3 {
your: style;
}

.mySearch h3 a {
your: style;
}

.mySearch h3 a:hover {
your: style;
}

.mySearch p {
your: style;
}

.mySearch p em {
your: style;
}

.mySearch p em.higlight {
your: style;
}

greetz

Posted: Tue 22. May 2007, 09:58
by TI&OSM
Jensensen and Pico,

Many thanks for your contribution!!!!!
I really appreciate it and it brings me a step forward
in freedom of designing with phpwcms.

Robert [TI&OSM]

Re: named anchor? link content of different blocks?

Posted: Fri 4. Apr 2008, 13:22
by powlido
Hi Jensensen,

Thanks for this piece... however I am having a little trouble using.

I appear to have it set up ok but my results appear with another search box above.

How do get rid of that? - I am using a 'search' content part in my article - should I use something another CP?

many thanks,

paul

Re: named anchor? link content of different blocks?

Posted: Fri 4. Apr 2008, 14:35
by Jensensen
depends on what you want? don't know, can't see...

Think about your templates to use it (whenever possible!) with a certain CP. Add/edit your HTML and then add CSS as needed.