On my website, I have been changing the css formating for my menu (primary-links) to have a box surrounding the entire section and a box surrounding each of the links. Within the box surrounding the entire section I want to put a "nolink" code segment and use the invoke module function to invoke my Google CSE Search Module. This requires the use of php, and when I preform this, it does not display (I assume the add link segment does not allow for use of php). It would be helpful to be able to write php the special menu item module. The code that I was trying to add as a "nolink" item is as follows:
<br /><?php $block = module_invoke('google_cse', 'block', 'view', 0); print $block['content']; ?>
Comments
Comment #1
campjacob commentedIs this possible?
Comment #2
campjacob commentedFound a solution using jquery
placed a nolink in my menu list (had to place it at a secondary level because otherwise it showed up on my navbar list). I made the primary level link always expanded. Within the link I created the following as the title:
<div id="nolink-search"></div>Then I added a block with the following jquery script:
<script type="text/javascript">$("#nolink-search").append($("#block-google_cse-0"));</script>This functions... but I still think it would be best to be able to put PHP directly into the link (html is available, but not PHP and I'm not sure why). Hope this helps anybody trying to do something similar.
Comment #3
gagarine commentedI will not allow that (I'm totally against PHP in the UI).