Dynamic title errors


I'm trying to set dynamic titles on my pages with a switch statement, but can't get it to work.



Tried ifelse using code gleaned from Google but it didn't work.



I'm trying to get it so that all my pages' titles are able to be dynamically used from a value across the site stored in my main file - content.php



This is my code:



```
<TITLE>My page title</TITLE>

<echo $mypagecontent ?>
```

Fairly basic, but the site is being developed on localhost anyway.



I would appreciate any help with this, as it's a new one for me!
try this and try to modify accordingly -



```
<?
//content is the array of titles which comes from the content.php page or the entire code can be put in the content.php
$content = array('title1 - This is the Homepage','title2 -Find new friends','title3 - Get your visa cleared now','title4 - bark about your wife here','title5 - Dont have kids yet','some other page');

$arr = explode('/',$_SERVER['PHP_SELF']);

$current_page = $arr[count($arr)-1];
//list your pages here
$pages  = array("1=>index.php","2=>friends.php","3=>nicks.php","4=>rent.php","5=>test.php");
for($i = 0; $i<count($pages);$i++)
{
	if($pages[$i] == trim($current_page))
		$pages_index = $i;
	else $pages_index = 6;
}
//This will echo the title
echo $content[pages_index];
?>
```

ask,if you stuck up somewhere.
dear [@supu123](/u/supu123) ,

look in the uipath explorer the selector for multiple times and observe keenly whether the title changes or not

if the title is changing then

replace title- 'delhi high court - "’ or just ""

also look at your case number variable that you are fetching is it the exact name as it … May be the function is executed before the document is ready.
Try to use document.ready function like this:



```
$( document ).ready(function() {
    $('#machines').change(function() {
        var $selected = $(this).find(':selected');
        $('#description').html($selected.data('description'));
    }).trigger('change');
});

``` this is not a topic list but a summary of this guide. it uses disco toc a great theme component

[image]

[discotoc - automatic table of contents](https://meta.discourse.org/t/discotoc-automatic-table-of-contents/111143) [theme](/c/theme/61)

this is a theme component that will allow you to generate an interactive table of contents for your topics with one click! … Let's say in your `settings.py` file you have:



```
SITE_URL='www.mydomain.tld/somewhere/'
SITE_NAME='My site'

```

**If you need that in just one or two views:**



```
from django.shortcuts import render_to_response
from django.conf import settings

def my_view(request, ...):
    response_dict = {
        'site_name': settings.SITE_NAME,
        'site_url': settings.SITE_URL,
    }
    ...
    return render_to_response('my_template_dir/my_template.html', response_dict)

```

**If you need to access these across a lot of apps and/or views, you can write a context processor to save code:**


James has a tutorial on this 
[online](http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/).


Some useful information on the when and if of context processors is available on this very site 
[here](https://stackoverflow.com/questions/831301/when-is-it-appropriate-to-use-django-context-processors).


Inside your `my_context_processors.py` file you would:



```
from django.conf import settings

def some_context_processor(request):
    my_dict = {
        'site_url': settings.SITE_URL,
        'site_name': settings.SITE_NAME,
    }

    return my_dict

```

Back in your `settings.py`, activate it by doing:



```
TEMPLATE_CONTEXT_PROCESSORS = (
    ...

    # yours
    'my_context_processors.some_context_processor',
)

```

In your `views.py`, make a view use it like so:



```
from django.shortcuts import render_to_response
from django.template import RequestContext

def my_view(request, ...):  
    response_dict = RequestContext(request)
    ...
    # you can still still add variables that specific only to this view
    response_dict['some_var_only_in_this_view'] = 42
    ...
    return render_to_response('my_template_dir/my_template.html', response_dict)

``` hey [@andre601](/u/andre601) ! i think there is a webhook that fires for that:

<https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request>

check out the action key in the payload, it has support for state changes between draft and non-draft states. I suppose you could try overriding the encoding in the `HtmlWeb` object.


Try this:



```
var web = new HtmlWeb
{
    AutoDetectEncoding = false,
    OverrideEncoding = myEncoding,
};
var doc = web.Load(myUrl);

```

Note: It appears that the `OverrideEncoding` property was added to HTML agility pack in revision 76610 so it is not available in the current release v1.4 (66017). The next best thing to do would be to read the page manually with the encodings overridden. oh, sorry everyone. lemme try to help.

fair warning: it’s well after midnight and i should be asleep. i haven’t tested this config but i have verified that it loads successfully.

this is probably what you want:

localhost

templates

encode gzip

file\_server

root * /home/html

php\_fastcgi unix//tmp/p… for example, you can disable right click on images at your page:

```

$(document).ready(function() {
    $("img").on("contextmenu",function(){
       return false;
    }); 
}); 

``` hey there!

terribly sorry for all the delay but i must have totally missed your message and the thread. just posted the solution to another public thread you opened:

[image]

[still using custom domain on free tier](https://community.auth0.com/t/still-using-custom-domain-on-free-tier/59611/15) [general](/c/general/6)

got most of the information i need. will continue … > 
> When I'm on a discussion, it shows up!
> 
> 
> 


The discussion still based on the old code.



> 
> Or do any of you guys still have it available?
> 
> 
> 


It is still possible to use:


![](http://pix.academ.info/img/2017/11/18/3d272cacfc99d5afdf92f0374cf5c406.png)


You just need to turn off the new code:


* Go to any page of the forum (this page is good).
* Write `duo.old_web_url_whitelist=["^.+"];` in the browser console and press "Enter".
* Go to home, then to the lingot store, and take the test.
* Enjoy!