Open fritzmg opened 1 year ago
The iso_filter_mate template currently has the following code:
iso_filter_mate
<?php if ($this->hasSearch): ?> <div class="search"> <div class="heading"><?php echo $this->keywordsLabel; ?></div> <form action="<?php echo $this->action; ?>#sidebar-content" method="get"> <input type="hidden" name="isorc" value="<?php echo \Input::get('isorc'); ?>"> <?php /*<label for="ctrl_keywords_<?php echo $this->id; ?>"><?php echo $this->keywordsLabel; ?></label>*/?> <input type="text" name="keywords" id="ctrl_keywords_<?php echo $this->id; ?>" class="text" value="<?php echo $this->keywords; ?>" placeholder="<?php echo $this->defaultSearchText; ?>"> <input type="submit" class="submit" value="<?php echo $this->searchLabel; ?>"> </form> </div> <?php endif; ?>
However, there is no $this->action variable (anymore) - which results in the following HTML output:
$this->action
<form action="#sidebar-content" method="get"> … </form>
This in turn causes the request to always to go to https://example.com/#sidebar-content, no matter where this filter is used.
https://example.com/#sidebar-content
To fix this, the action needs to be removed completely:
<?php if ($this->hasSearch): ?> <div class="search"> <div class="heading"><?php echo $this->keywordsLabel; ?></div> - <form action="<?php echo $this->action; ?>#sidebar-content" method="get"> + <form method="get"> <input type="hidden" name="isorc" value="<?php echo \Input::get('isorc'); ?>"> <?php /*<label for="ctrl_keywords_<?php echo $this->id; ?>"><?php echo $this->keywordsLabel; ?></label>*/?> <input type="text" name="keywords" id="ctrl_keywords_<?php echo $this->id; ?>" class="text" value="<?php echo $this->keywords; ?>" placeholder="<?php echo $this->defaultSearchText; ?>"> <input type="submit" class="submit" value="<?php echo $this->searchLabel; ?>"> </form> </div> <?php endif; ?>
or use something like this:
<?php if ($this->hasSearch): ?> <div class="search"> <div class="heading"><?php echo $this->keywordsLabel; ?></div> - <form action="<?php echo $this->action; ?>#sidebar-content" method="get"> + <form action="<?= Contao\Environment::get('request') ?>#sidebar-content" method="get"> <input type="hidden" name="isorc" value="<?php echo \Input::get('isorc'); ?>"> <?php /*<label for="ctrl_keywords_<?php echo $this->id; ?>"><?php echo $this->keywordsLabel; ?></label>*/?> <input type="text" name="keywords" id="ctrl_keywords_<?php echo $this->id; ?>" class="text" value="<?php echo $this->keywords; ?>" placeholder="<?php echo $this->defaultSearchText; ?>"> <input type="submit" class="submit" value="<?php echo $this->searchLabel; ?>"> </form> </div> <?php endif; ?>
I have the same Problem. Contao 4.13.43. Which template needs to be changed?
@Manfred-Gipp see the initial description
The
iso_filter_mate
template currently has the following code:However, there is no
$this->action
variable (anymore) - which results in the following HTML output:This in turn causes the request to always to go to
https://example.com/#sidebar-content
, no matter where this filter is used.To fix this, the action needs to be removed completely:
or use something like this: